Chmod Calculator
Including the fourth digit that most calculators leave out.
Turn file permissions between octal and symbolic form, with setuid, setgid and the sticky bit explained and the dangerous combinations flagged.
| Who | Read4 | Write2 | Execute1 |
|---|---|---|---|
| OwnerThe user who owns the file | |||
| GroupMembers of the file's group | |||
| OthersEveryone else on the system |
Special bits
Common modes
- Owner
- can read, write
- Group
- can read
- Others
- can read
Nothing worth flagging about this mode. It is an ordinary, unsurprising set of permissions.
A capital S or T in the output means the special bit is set on something that cannot execute, which does nothing at all and is nearly always a mistake — the lower-case form is what you want. And a note on 777: it is what people reach for when a permission problem is not understood, and it replaces one problem with a different and worse one.
How the Chmod Calculator works
Three octal digits and nothing more, until you reach the fourth. The special bits are the ones actually worth understanding: setuid on a writable file is a privilege escalation, and the sticky bit is the reason /tmp works at all.
Also known as: file permissions calculator · chmod 755 meaning · unix permissions calculator · octal permissions converter · linux file permission calculator
Frequently asked questions
What does chmod 755 mean?
The owner may read, write and execute; everyone else may read and execute. Each digit is a sum: 4 for read, 2 for write, 1 for execute, so 7 is all three and 5 is read plus execute. It is the usual mode for a program or a directory, where execute on a directory means the right to enter it rather than to run it.
What is the difference between 644 and 755?
The execute bit. 644 is the default for ordinary files — the owner can edit, everyone can read — and 755 adds execute for everyone, which is what a program or a directory needs. Applying 644 to a directory is a common mistake: you can list the names inside it and nothing more, since without execute you cannot enter it or read any file within.
What is the setuid bit?
It makes a program run as its owner rather than as whoever launched it, which is how passwd can update a file only root may write. It is correct for a handful of system binaries and a liability anywhere else, and on a world-writable file it is a direct privilege escalation: anyone can replace the contents of something that then runs as root. Every modern kernel ignores it on shell scripts precisely because it was too dangerous.
What is the sticky bit?
On a directory, it means only a file's owner may delete or rename it, even though the directory itself is writable by everyone. That is exactly what makes /tmp safe to share, and it is the right companion to any world-writable directory. On a file it means nothing on any current system; it once asked the kernel to keep the program in swap.
Why does my permission string show a capital S or T?
Because the special bit is set on something that cannot execute. A lower-case s means both setuid and execute are on; a capital S means setuid is on and execute is not, which does nothing at all and is nearly always a mistake. The same applies to T for the sticky bit.
Should I ever use chmod 777?
Almost never. It is what people reach for when a permission problem is not understood, and it replaces one problem with a different and worse one: anyone on the system can change the file, and anything that runs or trusts it becomes a way in. The right fix is usually ownership or group membership rather than opening the file to everybody.
Related calculators
Number Base Converter
Binary, octal, decimal and hex, with nothing lost on a 64-bit value.
OpenSubnet Calculator
Including the /31 and /32 that most calculators get wrong.
OpenRegex Tester
Test a pattern, and read what it actually says in English.
Open