How to use the Chmod Calculator
- Tick the read, write and execute boxes for the owner, the group and everyone else, or click a preset such as 644 or 755.
- Alternatively type a numeric mode (
755,0644,4755) or a symbolic one (rwxr-xr-xoru=rwx,g=rx,o=rx); everything else updates. - Read the plain-English summary to check who can do what, and watch for warnings about risky settings.
- Enter the file or folder name, choose recursive if needed, and copy the ready-made
chmodcommand.
Features
- Checkbox grid for owner, group and others
- Numeric to symbolic and symbolic to numeric, both live
- Setuid, setgid and sticky bit support
- Plain-English explanation for files and directories
- Generated numeric and symbolic chmod commands
- Presets with advice, including why to avoid 777
How Unix permissions work
Every file and directory on Linux, macOS and other Unix-like systems carries a set of permission bits. They answer three questions for three groups of people. The groups are the owner (u, the user who owns the file), the group (g, members of the file’s group) and others (o, everyone else). The questions are whether each can read, write and execute.
For directories the same letters mean slightly different things. Read lets you list the names inside, write lets you create, rename and delete entries, and execute lets you enter the directory and reach the files in it. A directory with read but no execute shows file names you cannot open, which is why folders almost always pair r with x.
From checkboxes to numbers
Each permission has a value: read is 4, write is 2 and execute is 1. Add them up for each group to get one digit from 0 to 7, then write the three digits in owner, group, others order. That number is in octal (base 8), because each digit holds exactly three bits.
| Digit | Symbolic | Meaning |
|---|---|---|
| 7 | rwx | Read, write and execute |
| 6 | rw- | Read and write |
| 5 | r-x | Read and execute |
| 4 | r-- | Read only |
| 0 | --- | No access |
So 755 means the owner has 4+2+1 = 7 (rwx), and the group and others each have 4+1 = 5 (r-x), written symbolically as rwxr-xr-x. That is exactly what ls -l shows after the leading file-type character.
The permissions you will use most
- 644 for ordinary files: you edit, others read.
- 755 for directories and scripts: everyone can enter or run them, only you can change them.
- 600 for secrets such as SSH private keys and
.envfiles; SSH refuses keys that others can read. - 700 for private directories such as
~/.ssh.
Why chmod 777 is a bad fix
When an upload folder or script fails with “permission denied”, setting 777 makes the error disappear because everyone can do everything. It also means any user account or any compromised process on the server can rewrite your files, plant scripts or delete data. The real fix is usually ownership: make the web server’s user or group own the folder (with chown) and grant 755 or 775 to directories and 644 or 664 to files. Some hosting setups even refuse to run PHP scripts that are writable by others.
Special bits: setuid, setgid and sticky
A fourth, leading digit holds three special flags. Setuid (4) makes a program run with its owner’s privileges; passwd uses it to update the password file. Setgid (2) does the same with the group, and on a directory it makes new files inherit the directory’s group, which is ideal for shared project folders. The sticky bit (1) on a directory lets users delete only their own files, which is how /tmp (mode 1777) stays usable for everyone. In symbolic form these appear as s or t in the execute position, or as capital S or T when the underlying execute bit is off.
Tips and gotchas
chmod -R 755also marks every regular file as executable. To treat files and directories differently, usefindwith-type dand-type f, or the symbolicXpermission, which adds execute only to directories and files that already have it.- GNU chmod keeps the setuid and setgid bits on directories when you use a three-digit mode; use a symbolic mode such as
g-s, or an extra leading zero like00755, to clear them. - Permissions are checked against the most specific class only: if you are the owner, the owner digit applies even when the group or others digit is more generous.
Frequently asked questions
What does chmod 755 mean?
The owner can read, write and execute, while the group and everyone else can read and execute. In symbolic form that is rwxr-xr-x. It is the usual mode for directories and scripts.
What is the difference between 644 and 755?
644 (rw-r--r--) lets the owner edit and everyone read, with no execute permission. 755 adds execute for all three classes, which programs need to run and directories need to be opened.
Is chmod 777 ever safe?
Rarely. It lets anyone on the system modify the file. Fix ownership with chown and use 755 or 775 for directories and 644 or 664 for files instead.
What permissions should an SSH private key have?
Use 600 so only you can read and write it, or 400 for read-only. SSH refuses to use a private key that other users can read.
What do the s and t letters mean in ls output?
s in the owner or group execute position means setuid or setgid is set, and t in the others position means the sticky bit is set. A capital S or T means the special bit is set without the execute bit.