Calculate Linux file permissions in octal (e.g. 755, 644) and symbolic notation (rwxr-xr-x) with SUID, SGID, Sticky Bit, and common presets.
{{ pasteError }}
Accepts octal (3 or 4 digits) or symbolic notation, including a leading file-type character copied straight out of ls -l. This replaces the whole mask below.
{{ deltaError }}
{{ deltaStatus }}
Unlike the field above, this changes the existing mask instead of replacing it — just like chmod u+x file does, as opposed to chmod 750 file. Omitting who (e.g. bare +r) applies to owner, group and others; real chmod would also filter that through your umask, which this calculator does not model. Capital X only sets execute when {{ matrixTarget === 'directory' ? 'this is a directory (it is, per the toggle below) — so it always applies' : 'the target is a directory or already has execute somewhere — set the "Applies to" toggle below to "Directory" to test that case' }}.
On a file: read views its contents, write modifies them, execute runs it as a program or script. These three bits mean exactly what they say.
On a directory these bits mean something else: read lists the names of entries inside (not their contents or permissions); write allows creating, deleting or renaming entries inside (not editing the directory's own bytes); execute allows entering it and reaching entries by name — without it, even a readable directory's contents are unreachable. A common directory mode is 755 even when the equivalent file mode is 644, because directories usually need that execute/traversal bit that read-only files don't.
Applying this mode to a directory with no execute bit set makes it non-traversable — files inside become unreachable even if they're individually readable. Execute on a directory means "can be entered/listed", not "can be run"; it's unrelated to what execute means for a file.
A single mode rarely fits both files and directories in the same tree: give files 644 and their directories still need execute to be traversable, or give everything 755 and every file — including plain data — looks executable. The mode above ({{ octalString }} / {{ symbolicString }}) is treated as the file mode here; directories in the tree get their own mode, right below.
Special bits (SUID/SGID/sticky) above aren't duplicated here — a sticky bit on a shared directory (e.g. /tmp) is common but independent of this file/directory split; set it per-entity if you need it.
This applies {{ octalString }} to directories too, overriding the {{ dirOctalString }} derived above — only use it if that's really what you want (e.g. a tree of non-executable data with no subdirectories that need traversal).
Linux permissions consist of three permission trios for Owner, Group, and Others. Each trio is assigned bits for Read (4), Write (2), and Execute (1) — the same three bits, but they mean different things depending on what they're set on:
For files: read opens the file's contents (e.g. cat, an editor, a browser download); write modifies those contents in place; execute runs the file directly as a program or script — meaningless on plain data, required on a binary or a script with a shebang line.
For directories: read lists the names of the entries inside (not their contents, sizes, or permissions — those need execute); write allows creating, deleting, or renaming entries inside the directory itself (it does not let you edit a file's contents just because you can write to the directory it lives in, and does not require write on the entries being renamed/deleted); execute allows entering the directory and reaching an entry by name — without it, ls can't stat() anything inside even if read is set, and cd fails outright. This is why a read-only directory typically still needs execute (755, not 644) while a read-only file does not.
100% Client-Side: Calculations are instant in browser memory.