Chmod calculator for Linux and Unix permissions
Every file on Linux, macOS and other Unix systems has three sets of permissions — for its owner, its group and everyone else — and chmod sets them with either a number like 755 or letters like u=rwx,g=rx,o=rx. This chmod calculator converts between the two. Tick the checkboxes or type a mode, and the octal value, the ls -l style string and ready-to-run commands update together.
How octal permissions work
Each digit is the sum of three values: read = 4, write = 2, execute = 1. So 7 is 4 + 2 + 1 (rwx), 6 is 4 + 2 (rw-), 5 is 4 + 1 (r-x) and 4 is read only. The three digits apply to owner, group and others, in that order. An optional fourth digit in front holds the special bits: setuid = 4, setgid = 2, sticky = 1.
Example: chmod 755
Entering 755 produces:
Octal: 755
Symbolic: rwxr-xr-x
Owner (u): read, write, execute
Group (g): read, execute
Others (o): read, execute
Commands:
chmod 755 file
chmod u=rwx,g=rx,o=rx file
chmod -R 755 directory/ # recursive
It works the other way too: typing rw-r----- gives 640 and the command chmod u=rw,g=r,o= file. You can paste the first column of ls -l output, including the leading - or d.
Common permission values
| Octal | Symbolic | Typical use |
|---|---|---|
| 644 | rw-r--r-- | Regular files, web pages, config files readable by all |
| 755 | rwxr-xr-x | Directories, scripts and programs |
| 600 | rw------- | Private files such as SSH private keys and .env files |
| 700 | rwx------ | Private directories like ~/.ssh |
| 640 | rw-r----- | Files a service group may read but others may not |
| 775 | rwxrwxr-x | Shared project directories where the group can write |
| 1777 | rwxrwxrwt | Shared temp directories such as /tmp |
If you just created a key with the SSH key generator, the private key file should be 600 — SSH refuses keys that other users can read.
Special bits: setuid, setgid and sticky
- setuid (4xxx) runs an executable with the file owner's privileges.
4755shows asrwsr-xr-x. The calculator warns you, because a setuid program owned by root is a common attack target. - setgid (2xxx) on an executable runs it with the file's group; on a directory, new files inherit the directory's group, which is useful for team folders (
2775). - Sticky (1xxx) on a directory lets only a file's owner delete or rename it, even when everyone can write to the directory.
A lowercase s or t means the special bit and execute are both set. An uppercase S or T means the special bit is set without execute, which is usually a mistake. The symbolic command carries the special bits too: 2775 gives chmod u=rwx,g=rwxs,o=rx file, and the sticky bit is appended as +t.
Common mistakes
- chmod 777 to "fix" an error. It makes the file world-writable, so any user or compromised process can change it. The tool flags this. Usually the right fix is correct ownership (
chown) plus 755 or 775. - Recursive 644 on a directory tree.
chmod -R 644strips execute from directories, and you can no longer enter them. Usechmod -R u=rwX,go=rX— the capitalXadds execute only to directories and files that already have it. - Leading zero confusion.
0755and755are the same mode; the leading 0 just means no special bits.
Curious how each digit maps to bits? The octal to binary converter shows 7 as 111 and 5 as 101, one bit per permission.
Privacy
The calculator runs entirely in your browser. It never touches your files; it only builds the commands for you to run yourself.