Chmod Calculator
Use this chmod calculator to convert Linux file permissions between checkboxes, octal numbers like 755 or 4755 and symbolic notation like rwxr-xr-x, and copy the chmod command.
| Read | Write | Execute | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Others |
| chmod command | | |
|---|---|---|
| Symbolic command | | |
| ls -l shows | | |
| Four-digit mode | |
Calculate chmod Permissions
Every file and directory on Linux, macOS and other Unix-like systems has permissions for three groups of users: the owner, the group and everyone else. This chmod calculator shows them three ways at once, as checkboxes, as an octal number such as 755 and as the symbolic string rwxr-xr-x you see in ls -l.
Change any of them and the others update instantly, including the setuid, setgid and sticky bits. Copy a ready chmod command in numeric or symbolic form, read in plain words who can do what, and get a warning when a mode is risky.
How to use the chmod calculator
- Tick the permissions for owner, group and others, or type an octal mode (
644) or a symbolic one (rw-r--r--). You can also paste the first column ofls -l, such asdrwxr-xr-x. - Add special bits if needed: setuid, setgid or the sticky bit.
- Enter the file or directory name and choose Recursive to apply the mode to a whole folder.
- Copy the command and run it in your terminal, for example
chmod 755 deploy.sh.
How octal permissions work
Each permission has a value: read = 4, write = 2 and execute = 1. Add them up for each class of user and write the three sums side by side: owner, group, others.
For 755: the owner has 4 + 2 + 1 = 7 (read, write, execute), the group has 4 + 1 = 5 (read, execute) and others have 5 as well. In symbolic form that is rwx r-x r-x, or rwxr-xr-x.
An optional fourth digit in front holds the special bits: setuid = 4, setgid = 2 and sticky = 1. So 4755 is 755 plus setuid, shown as rwsr-xr-x, and 1777 is 777 plus the sticky bit, shown as rwxrwxrwt. A lower-case s or t means execute is also set; a capital S or T means it is not.
On a directory, read lets you list its contents, write lets you create, rename and delete files in it (together with execute), and execute lets you enter it and reach the files inside.
Common chmod permissions
| Octal | Symbolic | Meaning | Typical use |
|---|---|---|---|
400 | r-------- | Owner can read only | Read-only secrets, for example an AWS .pem key |
600 | rw------- | Owner can read and write | SSH private keys, ~/.ssh/authorized_keys, .env files |
640 | rw-r----- | Owner read/write, group read | Config files read by a service group, log files |
644 | rw-r--r-- | Owner read/write, everyone read | Normal files: HTML, CSS, images, most configs |
664 | rw-rw-r-- | Owner and group read/write, others read | Files shared by a team in a group |
700 | rwx------ | Owner has full access | Private directories such as ~/.ssh, private scripts |
750 | rwxr-x--- | Owner full, group read/execute | App directories shared with a service group |
755 | rwxr-xr-x | Owner full, everyone read/execute | Directories, scripts and programs |
775 | rwxrwxr-x | Owner and group full, others read/execute | Shared project directories |
777 | rwxrwxrwx | Everyone has full access | Avoid: anyone on the system can change or delete |
440 | r--r----- | Owner and group read only | /etc/sudoers uses 0440 |
4755 | rwsr-xr-x | Setuid + 755 | Programs that run as their owner, such as passwd |
2775 | rwxrwsr-x | Setgid + 775 | Shared directories where new files keep the group |
1777 | rwxrwxrwt | Sticky bit + 777 | /tmp: everyone can write, only owners can delete |
Symbolic chmod commands
Besides numbers, chmod accepts symbolic changes: who (u owner, g group, o others, a all), an operator (+ add, - remove, = set exactly) and the permissions.
chmod +x script.shmakes a script executable for everyone (minus your umask).chmod u=rwx,g=rx,o= dirsets the exact mode 750.chmod -R u=rwX,go=rX site/uses a capitalX: execute is added only to directories and files that are already executable, which is the safe way to fix a whole web folder.
Security tips
- Never use 777 to fix an error. If a web server cannot write to a folder, change the owner or group (
chown) and use 775 or 770 instead. - Files 644, directories 755 is a sensible default for websites. Secrets such as
.envfiles and private keys should be 600 or 400; SSH refuses private keys that others can read. - Be careful with -R.
chmod -R 755also makes every file executable. Usefindwith-type fand-type d, or the capitalX, to treat files and directories differently. - Directories keep setuid/setgid. GNU chmod does not clear these bits on a directory when you give a three-digit mode; use
chmod g-s diror a five-digit mode such as00755. - Default permissions come from umask. With the common umask
022, new files get 644 and new directories 755; with002they get 664 and 775.
Working on server networking too? Plan address ranges with the subnet calculator and firewall rules with the CIDR calculator.
Frequently Asked Questions
Common questions about chmod and file permissions.
The owner can read, write and execute (7), while the group and others can read and execute (5). It is the usual mode for directories and scripts: rwxr-xr-x.
The owner can read and write (6) and everyone else can only read (4): rw-r--r--. It is the standard mode for regular files such as web pages and images.
It gives every user on the system permission to change, replace or delete the file. On a web server, a compromised process could modify your code. Fix ownership and use 755 or 775 instead.
Setuid (the 4 in 4755) makes a program run with the permissions of its owner instead of the user who started it. passwd uses it to update password files. It is shown as an s in the owner execute position.
On a directory, the sticky bit (the 1 in 1777) lets users delete or rename only their own files, even though everyone can write to the directory. /tmp uses it, shown as a t at the end: rwxrwxrwt.
Run chmod +x file to add execute for everyone, or chmod u+x file for the owner only. In octal, 755 or 700 are common choices for scripts.
The ~/.ssh directory should be 700, private keys 600 (or 400) and authorized_keys 600. OpenSSH refuses to use a private key that other users can read.