chmod Calculator
Toggle permissions visually to get the octal number, symbolic notation, and ready-to-paste chmod command.
Client-side only. Nothing leaves your browser
Type any value 000-7777 to decode it
As shown by ls -l
| Who | Read (r=4) | Write (w=2) | Execute (x=1) |
|---|---|---|---|
Owner u: the file's owner | |||
Group g: members of the file's group | |||
Other o: everyone else |
Special bits (setuid, setgid, sticky)
Target file or directory
Numeric (octal)
chmod 755 file.sh
Symbolic
chmod u=rwx,g=rx,o=rx file.sh
Recursive (for directories)
chmod -R 755 file.sh
What is chmod?
chmod (short for "change mode") is the Unix/Linux command that sets file and directory permissions. Every file on a Linux or macOS system has three permission groups (owner, group, and other), and each group has three permissions: read (r), write (w), and execute (x). chmod lets you toggle any combination using either numeric (octal) notation like 755 or symbolic notation like u+x. This calculator translates between the two so you can see exactly what each value means before running the command on your server.
How chmod Numbers Work
Each digit in a chmod number is the sum of three permission bits. Add them together to get the digit for that scope:
| Number | Permission | Symbol |
|---|---|---|
| 4 | Read | r |
| 2 | Write | w |
| 1 | Execute | x |
| 0 | No permission | - |
So 755 means owner gets 4+2+1=7 (rwx), group gets 4+0+1=5 (r-x), and other gets 4+0+1=5 (r-x), written as rwxr-xr-x. The three digits are always in the order owner-group-other.
chmod Cheat Sheet
The chmod values you'll actually use day to day:
| Octal | Symbolic | Typical Use |
|---|---|---|
| 777 | rwxrwxrwx | Full access for everyone (avoid on shared servers) |
| 755 | rwxr-xr-x | Executable scripts and directories. Owner full, others read+execute |
| 750 | rwxr-x--- | Group-shared executable, no access for others |
| 744 | rwxr--r-- | Owner full, group and others read-only |
| 700 | rwx------ | Private executable, only the owner can do anything |
| 644 | rw-r--r-- | Standard files. Owner can edit, everyone can read |
| 640 | rw-r----- | Owner edits, group reads, others locked out |
| 600 | rw------- | Private files: SSH config, ~/.ssh/authorized_keys |
| 400 | r-------- | Read-only private key, required for ~/.ssh/id_rsa |
Symbolic chmod Reference
You can also write chmod with letters instead of numbers. Combine a scope (u/g/o/a), an operator (+/-/=), and a permission (r/w/x):
| Command | Meaning |
|---|---|
| chmod u+x file | Add execute permission for the owner |
| chmod g-w file | Remove write permission for the group |
| chmod o=r file | Set other to read-only (clears w and x) |
| chmod a+r file | Add read permission for all (a = ugo) |
| chmod -R 755 dir | Recursively apply 755 to a directory tree |
| chmod +x script.sh | Shorthand to make a script executable |
Frequently Asked Questions
What does chmod stand for?
chmod is short for "change mode", the Unix command that changes the mode (permission bits) of a file or directory. It first appeared in AT&T Unix in the early 1970s and remains the standard way to set file permissions on Linux, macOS, BSD, and any other POSIX-compliant operating system. The related command chown changes the owner, and chgrp changes the group.
What is the difference between chmod 755 and chmod 777?
Both give the owner full read, write, and execute permissions. The difference is what the group and other (everyone else) can do. With 755 (rwxr-xr-x), the group and other can read and execute but cannot modify the file. This is the safe default for scripts, web files, and directories. With 777 (rwxrwxrwx), anyone on the system can read, modify, or replace the file, which is almost never what you want. Use 755 for executables and 644 for regular files; 777 should be a red flag in code reviews.
What chmod should I use for an SSH key?
Private SSH keys (~/.ssh/id_rsa, ~/.ssh/id_ed25519) require chmod 600, read and write for the owner only. Some users prefer chmod 400 to make the key read-only and prevent accidental edits. The ~/.ssh directory itself should be chmod 700, and authorized_keys should be chmod 600. If permissions are looser than this, SSH will refuse to use the key with a "permissions are too open" warning. Public keys (.pub files) can safely be chmod 644.
How do I chmod a directory recursively?
Use the -R (recursive) flag: chmod -R 755 mydir applies 755 to the directory and everything inside it. Be careful with recursive chmod on directories that mix files and subdirectories. Files usually need 644 while directories need 755 (because 'execute' on a directory means 'list contents'). A common idiom is: find mydir -type d -exec chmod 755 {} ; and find mydir -type f -exec chmod 644 {} ; to set them independently.
Why is chmod 777 dangerous?
chmod 777 grants read, write, and execute permission to every user on the system, including the web server, other unprivileged accounts, and (on shared hosts) other tenants. Anyone who lands a shell on the box can modify the file, replace it with a malicious version, or execute it. For web applications, 777 on a directory means an attacker who can upload a file can also run it as a script. The fix is almost always to set the file's owner correctly with chown, then use 755 or 644.
Related Tools
htpasswd Generator
Generate htpasswd entries for Apache, Nginx, and Traefik basic auth. bcrypt, apr1, MD5, and SHA-1.
SSL Checker
Check SSL/TLS certificate validity, expiry, chain, and issuer for any domain. Color-coded expiry warnings.
Certificate Decoder
Decode X.509 PEM certificates. View subject, issuer, validity, SANs, key usage, and SHA fingerprints.
Cron Generator
Generate, validate, and translate cron expressions. Visual cron builder with human-readable descriptions.
Cron to systemd Timer
Convert cron expressions to systemd .service and .timer files with OnCalendar syntax.
Need to manage SSH connections?
SSH Workbench lets you connect, browse files, and manage servers visually.
Try SSH Workbench Free