Chmod calculator
Compute your chmod permissions and commands with this online chmod calculator.
About Chmod calculator
Builds a Unix file permission from checkboxes: tick read, write and execute for the owner, the group and everyone else, and get the octal value (such as 755), the symbolic form (rwxr-xr-x) and the ready-to-run chmod command.
When you would use it
- Working out the right chmod value for a script, a web directory or a private key file.
- Decoding a permission string seen in ls -l into what each class may do.
- Checking what 644, 600 or 777 actually grant before copying a command from the internet.
How to use it
- Tick the permissions for owner (u), group (g) and public (o).
- Read the octal and symbolic representations.
- Copy the chmod command and replace path with your file or directory.
Things worth knowing
- Each digit adds read (4), write (2) and execute (1): 7 is rwx, 6 is rw-, 5 is r-x, 4 is r--, 0 is ---. The three digits are owner, group and others in that order.
- For directories, execute means being allowed to enter and list the directory, so directories normally need x (755 or 700) where files need only r (644 or 600).
- Private key files and credentials should be 600 (or 400): SSH refuses keys readable by others. 777 gives everyone write access and is almost never the right fix.
- This tool covers the basic bits only. The setuid, setgid and sticky bits (a leading fourth digit such as 4755) and ACLs are not represented.
Frequently asked questions
- What is the difference between 755 and 644?
- Both let the owner read and write and everyone else read; 755 also lets everyone execute. Use 755 for directories and scripts, 644 for ordinary files such as HTML or images.
- How do I apply a permission to a whole directory tree?
- Add -R to the command (chmod -R 755 dir), but be careful: it gives the same bits to files and directories. Prefer find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} + to treat them separately.