What is the Chmod Calculator?
The Chmod Calculator converts Unix/Linux file permissions into the numeric (octal) notation used by the chmod command, plus the symbolic rwxrwxrwx string. On Unix-like systems every file has three permission groups — owner, group, and other — and each group can grant read, write, and execute access. This tool is universal to any POSIX system (Linux, macOS, BSD).
How to use it
Tick the boxes for the permissions you want to grant in each row. The owner row controls the file's creator, the group row controls members of the file's group, and the other row controls everyone else. The calculator instantly returns the 3-digit octal mode you can paste into a command like chmod 755 file, along with the human-readable symbolic form.
The formula explained
Each permission has a value: read = 4, write = 2, execute = 1. For each group you add the values of the permissions granted to get a single digit from 0 to 7:
$$\text{digit} = 4\cdot\text{r} + 2\cdot\text{w} + 1\cdot\text{x}$$
The three digits are written in order owner-group-other to form the final mode.
$$\text{Chmod} = \underbrace{\left(4\,\text{r} + 2\,\text{w} + \text{x}\right)}_{\text{Owner}} \;\underbrace{\left(4\,\text{r} + 2\,\text{w} + \text{x}\right)}_{\text{Group}} \;\underbrace{\left(4\,\text{r} + 2\,\text{w} + \text{x}\right)}_{\text{Other}}$$
Worked example
Suppose the owner can read, write and execute \((4+2+1 = 7)\), the group can read and execute \((4+0+1 = 5)\), and other can read and execute \((4+0+1 = 5)\). The result is 755, symbolic rwxr-xr-x — the classic mode for an executable script or directory.
FAQ
What does 644 mean? Owner read+write (6), group read (4), other read (4) — a typical mode for non-executable files like documents.
What does 777 mean? Everyone can read, write and execute. It's convenient but insecure and generally discouraged.
Why is execute needed on directories? On a directory the execute bit lets you enter it and access files inside, so directories usually need execute wherever read is granted.