chmod Calculator
Convert Unix file permissions (read, write, execute for owner, group, other) to the octal chmod code. Essential for Linux and macOS developers.
How to use this tool
- Set owner, group, and other permissions (0–7).
- Add permission bits: 4 = read (r), 2 = write (w), 1 = execute (x).
- Copy the octal code and run: chmod 754 filename
Convert read/write/execute permissions for owner, group, and other into the numeric octal chmod code used on Linux and macOS.
Formula
Each permission digit is the sum of its active bits: r = 4, w = 2, x = 1.
Octal code = owner_digit group_digit other_digit, where each digit ∈ {0…7}.
Symbolic form: for each digit n, bit-test n & 4 → r or -; n & 2 → w or -; n & 1 → x or -.
How it works
This calculator converts three separate octal permission values (owner, group, other) into a Unix chmod octal code and its equivalent nine-character symbolic string. Each digit is treated as a 3-bit field where the bits independently represent read, write, and execute access. The result is exact — Unix permission encoding is purely arithmetic with no rounding or estimation involved.
Worked example
Worked example
- Owner = 7: bits 4+2+1 are all set → read, write, execute → rwx
- Group = 5: bits 4+1 are set (not 2) → read, execute, no write → r-x
- Other = 4: only bit 4 is set → read only → r--
- Octal code: concatenate the three digits → 754
- Symbolic: concatenate the three rwx strings → rwxr-xr--
Octal code: 754 | Symbolic: rwxr-xr--
Key terms
- Octal notation
- A base-8 number system used to represent Unix permissions; each digit (0–7) encodes three permission bits in a single character.
- Read (r)
- Permission bit with value 4; allows a user to view the contents of a file or list a directory.
- Write (w)
- Permission bit with value 2; allows a user to modify or delete a file, or create/remove files within a directory.
- Execute (x)
- Permission bit with value 1; allows a user to run a file as a program or enter a directory.
- Symbolic notation
- A nine-character string (e.g. rwxr-xr--) representing owner, group, and other permissions in human-readable form.
Frequently asked questions
- What does chmod 755 mean?
- 755 means: owner has read+write+execute (7), group has read+execute (5), others have read+execute (5). Symbolic: rwxr-xr-x. Common for executables and directories.
- What is chmod 644?
- 644 means owner can read+write (6), group and others can only read (4). Symbolic: rw-r--r--. Standard for web files and config files.