How to use the Chmod calculator tool
- Type a mode into the Octal or symbolic permissions box: three or four octal digits such as 755 or 4755, or nine characters such as rwxr-xr-x.
- You can also paste the ten-character form from ls -l, such as -rw-r--r--. The leading type character is ignored.
- Select Convert, or select Example to try 0755.
- Read the other notation in the Result box: octal input returns nine symbolic characters, symbolic input returns a four-digit octal mode.
- Select Copy to use the value in a chmod command or a script.
How octal and symbolic permissions map to each other
A Unix file mode has three permission sets, in this order: owner, group and others. Each set has three bits. Read is worth 4, write 2 and execute 1, and the octal digit is their sum. So 7 is rwx, 6 is rw-, 5 is r-x and 4 is r--.
An optional fourth digit in front holds three special bits: setuid is 4, setgid is 2 and the sticky bit is 1. In symbolic form they share the execute position. Setuid shows as s in the owner set, setgid as s in the group set and sticky as t in the others set. The letter is lowercase when execute is also set and uppercase (S or T) when it is not.
Chmod calculator examples
Each line below is real output from this tool. The last two go from an ls -l string to octal.
644 -> rw-r--r--
0755 -> rwxr-xr-x
4755 -> rwsr-xr-x
2775 -> rwxrwsr-x
1777 -> rwxrwxrwt
4644 -> rwSr--r--
-rw------- -> 0600
drwxrwxrwt -> 1777Modes you will see in practice
On a directory the bits mean something slightly different: read lists the entries, write creates and deletes entries, and execute allows entering the directory and reaching the files inside it.
- 644: files that everyone may read and only the owner may edit.
- 755: directories and executables that others may enter or run but not modify.
- 600: private files such as SSH keys. OpenSSH refuses a private key that group or others can read.
- 1777: world-writable directories like /tmp, where the sticky bit stops users from deleting each other's files.
- 2775: shared project directories. With setgid on a directory, new files inherit the directory's group.
- 4755: setuid programs such as passwd, which run with the file owner's privileges.
Input the tool accepts and rejects
Octal input must be exactly three or four digits from 0 to 7. Symbolic input must be exactly nine permission characters, or ten when the first is a type character such as -, d or l. Surrounding spaces are trimmed. Anything else returns the message Enter an octal mode or nine permission characters, such as rwxr-xr-x.
That excludes chmod's relative syntax such as u+x, go-w or a=r, because those describe a change, not a complete mode. A trailing + or . from ls, which marks an ACL or security context, must be removed first. The calculator only converts notation and does not change any file.
Frequently asked questions
What does chmod 755 mean?
The owner can read, write and execute. Group members and everyone else can read and execute but not write. In symbolic form it is rwxr-xr-x.
What does a capital S or T mean in a permission string?
The special bit is set but the execute bit in the same position is not. For example, 4644 displays as rwSr--r--. This is often a mistake, since setuid without execute has no useful effect on a regular file.
Why is chmod 777 a bad idea?
777 lets every user on the system modify or replace the file, and on a directory lets anyone add or delete entries. Grant write access to the owner or one group only.
How do I convert rwxr-xr-x to a number?
Split it into three groups and add 4 for r, 2 for w and 1 for x in each: rwx is 7, r-x is 5, r-x is 5, giving 755. This tool returns the same answer with the leading special digit, 0755.
Does the leading zero in 0755 matter?
For chmod on the command line, 755 and 0755 are equal: the first digit is the special-bits digit and zero means none are set. In many programming languages a leading zero or 0o prefix marks an octal literal, so it is required there.