Convert between 755 and rwxr-xr-x, with setuid, setgid and sticky supported
| Who | Read | Write | Execute |
|---|---|---|---|
| Owner (u) | |||
| Group (g) | |||
| Others (o) |
The three digits stand for owner, group and others, in that order. Each digit is read 4 plus write 2 plus execute 1, so 7 is 4+2+1 (read, write and execute), 5 is 4+1 (read and execute) and 4 is read only.
755 is the usual choice for directories and executables. On a directory the execute bit means "you may enter it", so removing it makes the directory unusable even when it is readable. 644 is the usual choice for regular files: the owner can edit, everyone else can only read. Older guides still suggest 777 for web files, which lets anyone overwrite them; avoid it on shared hosts.
The leading digit of the four-digit form holds the special bits. setuid (4) runs the program as its owner and setgid (2) does the same for the group. setgid on a directory makes new files inherit the parent group, which is why shared directories use it. sticky (1) is the 1777 on /tmp: everyone may write, but nobody may delete another user's files.
An uppercase S or T in the symbolic form means the special bit is set while the execute bit is not. That combination is usually unintended, so this tool shows the case faithfully.
| Numeric | Symbolic | Typical use |
|---|---|---|
| 644 | rw-r--r-- | Regular files. Only the owner can edit |
| 755 | rwxr-xr-x | Directories, executables, shell scripts |
| 600 | rw------- | SSH private keys, .env and other private config |
| 664 | rw-rw-r-- | Files edited by several people in one group |
| 1777 | rwxrwxrwt | /tmp. Anyone may write, nobody may delete others' files |
All calculation happens in your browser. Nothing you type is sent to a server.