ToolsForWeb

Saved

Tap ☆ on any tool to keep it here.

toolsforweb

Chmod Calculator

Convert between octal (755) and symbolic (rwxr-xr-x) permissions, with special bits and umask.

Runs in your browser — nothing is uploaded

Loading tool…

Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.

About this tool

Every Unix file carries three permission classes — owner, group, others — each with read, write and execute bits, plus three special bits: setuid, setgid and the sticky bit. The mode is written either in octal (755) or symbolically (rwxr-xr-x). This calculator converts between the two views, builds modes from per-class checkboxes, shows the digit-by-digit breakdown of who gets what, explains the special bits, and previews what new files and directories become under a given umask. Symbolic expressions follow GNU coreutils behaviour, including its quirks: bare = applies the umask, and letters that cannot apply to a who are silently dropped.

How it works

read = 4,  write = 2,  execute = 1
Each digit = sum of its permissions; digits are owner, group, others

Unix file modes give the owner, the group and everyone else a set of read, write and execute bits. Each bit has a value (4, 2, 1), so one octal digit describes a whole set, and three digits describe a file. Add the values you want to grant for each class.

Worked examples
QuestionWorkingAnswer
What does chmod 755 mean?7 = 4+2+1, 5 = 4+1, 5 = 4+1rwxr-xr-x (owner full; group and others read + execute)
What does chmod 644 mean?6 = 4+2, 4, 4rw-r--r-- (owner read + write; others read only)
What does chmod 600 mean?6 = 4+2, 0, 0rw------- (owner only)

When to use it

Writing a chmod command when you know the outcome you want but not the digits.
Decoding a mode from ls -l output (drwxr-sr-x) into what it actually grants.
Working out setuid/setgid/sticky-bit combinations without breaking the class bits.
Predicting the permissions of new files under a umask before deploying a service.
Learning the rwx ↔ octal mapping by toggling bits and watching both notations update.

Questions

What do 755, 644, 600 and 700 actually mean?

Each digit is one class's rwx as an octal number: read=4, write=2, execute=1. 755 = owner rwx (4+2+1), group and others r-x (4+1) — the norm for directories and executables. 644 = owner rw-, everyone else r-- — the norm for regular files. 600 = only the owner reads and writes, standard for private keys. 700 = like 755 but group and others get nothing — home and .ssh directories.

What does 777 actually cost me?

777 lets every user and every process on the system write the file — including ones you did not intend. On a shared host that is other tenants; on your own box it is every daemon. World-writable files are also the first thing attackers look for because they turn any low-privilege foothold into persistence. Directories should rarely be more open than 775 with group trust; 1777 (sticky) is the correct shape for genuinely shared scratch spaces like /tmp.

Why do directories need the execute bit, and what is the X letter for?

For a directory, x means permission to enter (traverse) it — without it, users can list names but cannot open anything inside. That asymmetry is why GNU chmod provides capital X: 'add execute only where it makes sense' — on directories, or on files that already have execute for some class. Lowercase +x on a file adds execute unconditionally; +X on a directory tree fixes traversal without making every data file executable.

What do setuid, setgid and the sticky bit do?

Setuid (4000) makes a program run as the file's owner — how passwd can write to root-owned files. Setgid (2000) runs programs as the file's group, and on directories makes new files inherit the directory's group, which is how shared team directories stay coherent. Sticky (1000) on a directory lets only the owner (or root) delete or rename entries, which is how /tmp stays world-writable without letting users delete each other's files. In ls output these show as s/S in the class's x position and t/T at the end.

How does umask math work?

A umask is the set of bits the system REMOVES from the defaults when a new file is created: 666 for files, 777 for directories. umask 022 removes w from group and others, so files come out 644 and directories 755; umask 077 removes everything from group and others, giving 600 and 700. The subtraction is bitwise (666 & ~022), which is why a umask can never add permissions. Note the 0 prefix is traditional octal notation — 022 and 22 are the same mask.

I typed chmod 755 but the symbolic view shows s or S — what happened?

A fourth digit was in play. 4755, 2755 and 1755 are 755 plus a special bit: setuid, setgid, sticky. Lowercase s or t means the special bit is set AND the class has execute; uppercase S or T means the special bit is set but the class lacks execute — usually a sign that an x was removed after the special bit was applied. The calculator's ls-style view shows exactly this distinction.

Related tools