How do chmod permissions work?
A chmod calculator converts Unix file permissions between checkboxes, octal such as 755 and symbolic such as rwxr-xr-x. This chmod calculator also applies chmod expressions like u+x, works out umask results and warns about risky modes.
Unix permissions are three sets of read, write and execute bits for the owner, the group and everyone else. Each set is a number: read is 4, write is 2 and execute is 1, so 7 is all three, 5 is read and execute and 6 is read and write. 755 means the owner has everything and others can read and execute.
Tick the boxes and the octal and symbolic forms update, or enter either form to see the checkboxes. You can apply a chmod expression such as u+x or g-w to a starting mode and see the result, work out the permissions that a umask produces for new files and directories, and see warnings for risky modes such as world-writable files.
The calculator describes modes; it does not change files. Special bits (setuid, setgid and the sticky bit) add a leading digit and have security consequences, so use them carefully.
Page updated .
How to use the chmod Calculator
- Tick the permissions, or enter an octal or symbolic mode.
- Read the other forms, or apply a chmod expression.
- Check the warnings and copy the chmod command.
Examples
755
rwxr-xr-x
rw-r--r--
644
644 with u+x
744
Tips
- Use 644 for files and 755 for directories and scripts as sensible defaults.
- Avoid 777: it lets everyone modify the file.
- Private keys should be 600 so only the owner can read them.
Specs & limits
- Forms
- Octal, symbolic, checkboxes
- Expressions
- chmod syntax such as u+x, go-w
- Umask
- Calculates default file and directory modes
- Special bits
- setuid, setgid, sticky
- Processing
- In your browser
Troubleshooting
›Invalid octal
Cause: A digit is above 7.
Fix: Use digits 0 to 7.
›Script will not run
Cause: The execute bit is missing.
Fix: Add x with chmod +x.
›SSH refuses a key
Cause: Permissions too open.
Fix: Set the private key to 600.
Frequently asked questions
›What does chmod 755 mean?
Owner read, write and execute; group and others read and execute (rwxr-xr-x).
›What does chmod 644 mean?
Owner read and write; group and others read only (rw-r--r--).
›What is a umask?
A mask that removes permissions from newly created files. A umask of 022 turns 666 into 644 and 777 into 755.
›What is the sticky bit?
On a directory it lets only the file owner delete files inside, as in /tmp.
›What do u, g, o and a mean?
User (owner), group, others and all.
›Why is 777 dangerous?
Any user on the system can read, change or run the file.