Chmod Calculator
Work out Unix file permissions without memorising the numbers. Tick the checkboxes or type an octal value and get the matching chmod command, the rwx string, and a plain description of who can do what.
Runs in your browser. Your files are never uploaded.
Loading Chmod Calculator…
How to use Chmod Calculator
- Tick read, write and execute for owner, group and others, or type an octal mode such as 644.
- Add setuid, setgid or sticky bits if needed.
- Read the octal number, symbolic string and the plain description.
- Copy the generated chmod command and run it in your terminal.
How Unix permissions work
Every file and directory on a Unix-like system carries permissions for three classes of user: the owner, members of the owning group, and everyone else. For each class there are three switches: read, write and execute. The chmod command changes these switches, and the settings are often written either as three octal digits or as a nine-character string such as rw-r--r--.
The octal form comes from adding bit values. The mode 640 means the owner can read and write, the group can read, and others have no access. The symbolic string simply lists every switch in order, with a dash wherever a permission is off.
Special bits and sensible defaults
A fourth leading digit adds three special bits. Setuid (4) makes an executable run with the owner's privileges, setgid (2) makes it run with the group's privileges or makes new files in a directory inherit its group, and the sticky bit (1) on a directory lets only a file's owner delete it, as in the shared temporary directory. In the symbolic string they appear as s or t in the execute position, or uppercase S or T when the underlying execute bit is not set.
For ordinary use, 644 for files and 755 for directories and programs is a reliable starting point. Private files such as SSH keys should be 600 so that no one else can read them, and many tools refuse to use a key that is more open.
- Never make web-server files writable by everyone.
- Scripts need the execute bit to be run directly.
- Setuid programs deserve careful review because mistakes can create security holes.
Notes on this calculator
The calculator describes the mode bits only. Whether a particular user can access a file also depends on file ownership, parent directory permissions, access control lists and mandatory access systems such as SELinux, none of which are modelled here.
The octal input accepts three or four digits from 0 to 7. All calculations happen in your browser, and no file names or paths are sent anywhere.
Why use this chmod calculator tool
- Both directions. Change the checkboxes to update the number, or edit the number to update the checkboxes.
- Symbolic and octal. See 755 and rwxr-xr-x side by side, plus a chmod u=rwx,g=rx,o=rx command.
- Special bits. Supports setuid, setgid and the sticky bit with correct s, S, t and T notation.
- Explained presets. Common modes such as 644, 600 and 755 come with a short explanation of when to use them.
Frequently asked questions
How are the numbers calculated?
Each permission has a value: read is 4, write is 2 and execute is 1. Add the values you want for each of the three groups. Read and write is 6, read and execute is 5, and all three is 7. The three digits are written in the order owner, group, others.
What do permissions mean on a directory?
Read lets you list the names inside, write lets you create, rename or delete entries, and execute lets you enter the directory and access items within it. A directory without execute permission is effectively unusable even if it is readable.
Is 777 ever a good idea?
Almost never. It lets every user on the system change or replace the file. If a program reports a permission error, it is better to fix the owner or group, or grant write access to a specific group, than to open the file to everyone.
More free tools
PX to REM Converter
Convert pixels to rem and em, and back, with a custom root font size. Includes a table of common sizes from 8px to 64px and a copy-ready CSS declaration.
Open toolBase64 Encode & Decode
Encode text to Base64 or decode Base64 back to text. Supports UTF-8 and URL-safe Base64. Free, instant and runs in your browser.
Open toolURL Encode & Decode
Encode or decode URLs and query strings with percent-encoding. Choose component or full-URL mode. Free, instant and private.
Open tool