chmod Calculator
Calculate Unix file permissions instantly. Switch between octal (755), symbolic (-rwxr-xr-x) and a visual checkbox grid. Includes setuid, setgid and sticky-bit support.
chmod Calculator Tool
Advanced — setuid, setgid, sticky bit
setuid runs the executable as the file owner. setgid inherits the group; on dirs, new files inherit the dir's group. sticky on a directory means only the file owner can delete it (used on /tmp).
How to use the chmod calculator
Click the permission checkboxes
Tick read, write or execute for owner, group and public independently. The octal and symbolic fields update live.
Or type a value directly
Paste an octal (e.g. 755) or a symbolic string (e.g. -rwxr-xr-x) into the input fields. The grid and other outputs reflect your input.
Try a preset
The preset pills (644, 755, 600, 1777, …) load common values instantly. Hover for what each is typically used for.
Copy the result
Use the Copy buttons to grab the octal, symbolic or full chmod command for pasting into your terminal or a deploy script.
Understanding Unix file permissions
Every file and directory on a Unix-like system — Linux, macOS, FreeBSD, the BSD-based router and NAS firmware that runs much of the internet — carries a small piece of metadata describing who is allowed to read it, modify it and (for executables) run it. That metadata is the permission mode, and the chmod command (CHange MODe) is how administrators and developers set it. The calculator above is a visual front-end for the same arithmetic that chmod performs.
Three classes, three bits
Unix permissions split the world into three classes: the file's owner (a specific user), the file's group (a specific group of users), and everyone else. For each class, the permission mode records three bits: read (4), write (2) and execute (1). Adding the bits per class gives a digit from 0 (no permissions) to 7 (read + write + execute). The mode is conventionally written as three octal digits — one per class — so 755 means owner has 7 (rwx), group has 5 (r-x) and public has 5 (r-x).
The symbolic form (rwxr-xr-x) writes the same information differently. A dash replaces a missing permission; the order is always read, write, execute for each class. The leading character indicates file type — usually - for a regular file, d for a directory, l for a symbolic link. So the symbolic form -rwxr-xr-x describes a regular file with mode 755.
The fourth digit and the special bits
Fewer developers know that chmod accepts a fourth, leading octal digit for the special bits. Setuid (4) makes an executable run with the owner's user-ID instead of the caller's — this is how sudo and passwd can do privileged work. Setgid (2) does the same for group; on directories it causes newly-created files to inherit the directory's group rather than the creator's primary group. The sticky bit (1) on a directory restricts deletion to the file's owner — Linux's /tmp uses mode 1777 so every user can write but no user can delete another user's files. Special bits combine with the regular bits using the same additive scheme.
The modes worth knowing, and where the rules come from
The presets above are the conventions, not laws: regular files usually want 644 (owner read+write, everyone else read-only) and directories 755 (owner read+write+search, everyone else read+search) because a umask of 022 produces exactly those from a fresh file. One case is enforced by software rather than convention: an SSH private key. ssh(1) says the identity files "contain sensitive data and should be readable by the user but not accessible by others (read/write/execute). ssh will simply ignore a private key file if it is accessible by others" — so 600 and 400 work and 640 fails as surely as 644. World-writable files (666, 777) mean any account on the host can replace the content; outside a sticky /tmp-style directory there is rarely a reason to want that.
Two things this calculator shows that are easy to misread. The symbolic string always begins with -, the regular-file marker — ls -l prints d for a directory and l for a symbolic link in that slot. And the special bits borrow the execute columns: POSIX ls(1) prints s where setuid or setgid is set on an executable and S where the bit is set but the execute bit is not; t and T do the same for the restricted-deletion (sticky) flag in the "other" column. The upper-case forms are almost always a mistake, and the grid makes the mismatch visible.
What chmod doesn't do
Permission modes are a coarse-grained access control — three classes, three bits. They do not handle "give Alice read access but not Bob" without elaborate group-juggling. For fine-grained control, modern Linux supports access control lists (ACLs) via setfacl and getfacl, which the basic chmod calculator cannot model. The mode also does not encrypt anything — it controls who can ask the kernel for a file, not what they can do once they have a copy. And it does not survive transit cleanly: copying a file via SCP, SFTP, or a Docker bind-mount frequently resets the mode to whatever the destination filesystem defaults to. When in doubt, run ls -la on the destination side and confirm.
The octal is binary, and OpenSSH will refuse you at 601
The octal digits aren't arbitrary: they map directly to binary. 755 in binary is 111 101 101 — one bit per permission per class.
ssh(1) is explicit: it "will simply ignore a private key file if it is accessible by others". Any group or other bit trips it — 640 fails exactly as 644 does — so 600 (or 400) is the whole answer.
The sticky bit's name is older than its meaning. Seventh Edition Unix chmod(2) listed 01000 as "save text image after execution"; POSIX.1-2024 defines S_ISVTX only as the directories' restricted deletion flag.
POSIX chmod(1) says clearing all execute bits also clears setuid and setgid, and leaves it implementation-defined whether u+s on a file with no execute bit is ignored — which is why the grid shows an upper-case S when you tick setuid without execute.
Linux's /tmp is the canonical sticky-bit directory. Mode 1777 — sticky + world-writable. Try ls -ld /tmp on any Linux system.
Recursive chmod (chmod -R 755 /) on a live system is one of the most catastrophic accidental commands. It changes EVERYTHING — including /etc/shadow.
The execute bit on a directory is a permission to enter the directory (cd into it, traverse it), not to "execute" files inside. Read alone gives you the file list; execute gives you traversal.
The umask is subtracted from a new file's requested mode: 022 turns a requested 666 into 644 and 777 into 755 — the two most common presets above. It also governs symbolic chmod: POSIX says chmod +x with no who sets execute for every class except the bits in your umask.
Whose group does a new file get? Linux open(2) documents two answers: System V semantics (the creator's group) by default, BSD semantics (the directory's group) when the directory has setgid set — the reason 2775 is the classic shared-project directory.
The twelve bits have not moved since Seventh Edition Unix (1979): its chmod(2) page lists 04000, 02000, 01000, 00400 … exactly the values POSIX.1-2024 still assigns to S_ISUID, S_ISGID, S_ISVTX and S_IRUSR.
Frequently asked questions
chmod 600 ~/.ssh/id_ed25519 (or whatever the key file is named) and try again.chmod +x script.sh sets it for owner, group and public except any class masked by your umask (POSIX chmod(1): with no who, the bits in the file-mode-creation mask are left alone) — under the usual 022 that is all three. For owner-only execution use chmod u+x script.sh. The calculator works in absolute octal, so the equivalent here is 744 or 755 rather than a +x edit.chmod 755 file) sets the mode absolutely. Symbolic (chmod u+rwx,g+rx,o+rx file) adds/removes individual bits. Symbolic is safer when you only want to flip one bit.find ... -exec chmod ... \; with type filters instead.2775 on a shared directory changes behaviour on Linux and is redundant on macOS.Method & sources
How it computes
Each class digit is read + write + execute = 4 + 2 + 1 and the optional leading digit is setuid 4 + setgid 2 + sticky 1 — the values POSIX.1-2024 <sys/stat.h> assigns (S_ISUID 04000, S_ISGID 02000, S_ISVTX 01000, S_IRWXU 0700, S_IRWXG 070, S_IRWXO 07).
What this tool implements
- Mode-bit values from POSIX.1-2024 <sys/stat.h>: S_ISUID 04000, S_ISGID 02000, S_ISVTX 01000 ('on directories, restricted deletion flag'), S_IRWXU 0700 down to S_IXOTH 01. The octal digit for each class is the sum of its three bits.
- Output is an absolute octal mode, one of the two forms POSIX chmod(1) accepts ('a symbolic_mode expression or a non-negative octal integer'). Symbolic +/- edits, whose result depends on the umask when who is omitted, are not modelled — the FAQ says so.
- The symbolic string follows POSIX ls(1): s where setuid/setgid is set on an executable, S where the bit is set without execute; t and T likewise for the restricted-deletion flag in the other column. The leading character is always -, the regular-file marker.
- Input tolerance: three- or four-digit octal (0–7 only), and nine- or ten-character symbolic strings drawn from rwxsStT-; anything else is ignored until it becomes valid, so a half-typed value never flips the grid.
- Presets are conventions, not rules, with one exception the page sources: ssh(1) ignores a private key that is 'accessible by others', so 600/400 are the only working modes for an identity file.
- Not modelled: umask, POSIX ACLs (setfacl/getfacl), and the BSD-vs-System V group-inheritance difference documented in open(2) — all three are named in the prose rather than silently omitted.
Sources
- IEEE Std 1003.1-2024 (POSIX.1-2024), Base Definitions, <sys/stat.h> — file mode bits and their octal values: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_sta…
- IEEE Std 1003.1-2024 (POSIX.1-2024), Shell & Utilities, chmod — absolute octal mode, symbolic_mode grammar, umask interaction, execute-bit rules for setuid/setgid: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/chmod.…
- IEEE Std 1003.1-2024 (POSIX.1-2024), Shell & Utilities, ls — the s/S/t/T/x/- characters of the long-format permission field: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ls.html
- OpenSSH ssh(1) manual page, FILES ~/.ssh/id_* — private keys must not be accessible by others: https://man7.org/linux/man-pages/man1/ssh.1.html
- Linux open(2) manual page, O_CREAT — System V vs BSD group semantics and the setgid directory rule: https://man7.org/linux/man-pages/man2/open.2.html; FreeBSD open(2): https://man.freebsd.org/cgi/man.cgi?query=open&sektion=2
- Seventh Edition Unix Programmer's Manual (1979), chmod(2) — 04000/02000/01000 'save text image after execution': https://man.cat-v.org/unix_7th/2/chmod
What can make this go out of date
- None at runtime. The mode bits are fixed by POSIX and have carried the same octal values since Seventh Edition Unix (1979); a new POSIX issue is the only thing that could move them.
Abridged — the full review record for this tool runs longer than the list above.
Pick up where you left off
Stored only in this browser — never sent to our servers.