chmod Calculator: Unix file permissions in octal and symbolic form
Permissions
Special bits
Octal and symbolic
Command
What this allows
On a directory, read lists its contents, write adds or removes entries and execute lets you enter it.
Special bits
On a directory, read lists its contents, write adds or removes entries and execute lets you enter it.
This tool works out Unix file permissions. Tick the read, write and execute boxes for the owner, the group and everyone else, add the setuid, setgid and sticky bits if you need them, and read off the octal number, the symbolic string and the chmod command.
You can also go the other way. Type an octal mode such as 755 or 4755, or a symbolic string such as rwxr-xr-x, and the grid updates to match. A plain-English list explains who can read, write and run the file, and a warning appears for risky modes such as 777.
The command can be copied in numeric or symbolic form, with an optional -R for directories and your own file name. Everything is calculated in your browser, so nothing is uploaded.
Each digit is one class: owner, group, then others. Read counts as 4, write as 2 and execute as 1, and you add them up. So 7 is read, write and execute (4+2+1), and 5 is read and execute (4+1). 755 means the owner can do everything while the group and others can read and run the file.
644 lets the owner read and write and everyone else only read. It suits normal files such as documents and web pages. 755 adds execute for everyone, which is needed for scripts, programs and directories.
777 lets every user on the system read, change and run the file. On a web server that can let an attacker modify your code. It is almost always better to give write access to one owner or one group, and the tool warns you when you choose it.
They are three extra bits shown as a fourth leading digit: 4 for setuid, 2 for setgid and 1 for sticky. Setuid and setgid run a program with the owner's or group's privileges. On a directory, setgid makes new files inherit the group, and the sticky bit, as on /tmp, stops users deleting files they do not own.
A lowercase s or t means the special bit is set and execute is also set. A capital S or T means the special bit is set but execute is not, which is usually a mistake.
It applies the change to a directory and everything inside it. Be careful: the same mode is usually wrong for both files and directories, because directories need execute to be entered.
No. The calculation runs in your browser and nothing you type is sent or stored.