chmod permission calculator

Type a file mode as octal (4755), as ls shows it (-rwsr-xr-x) or as chmod clauses on a base (g+s,o-rwx) and read it every other way: the bits, who may do what, what setuid, setgid and the sticky bit mean for a file or a directory, the commands that reach it, the umask that would create it, and a trace of each clause. From POSIX.1-2024 chmod and ls and coreutils 9.11 chmod(1); nothing leaves the browser.

Operations & Fieldcraft

Octal (one to five digits), an ls string (nine characters, or ten with the type letter), or chmod clauses separated by commas. A clause with no class (+x) is applied under the umask, as chmod does.

What the clauses are applied to. Blank means 644 for a file and 755 for a directory. On a directory, a numeric mode of up to four digits keeps its set-user-ID and set-group-ID bits, as GNU chmod does.

Bits set here are left alone by + and - when no class is named. Blank means 022.

2750drwxr-s---

Read as chmod clauses on the base. · binary 0101 1110 1000 · decimal 1512

The twelve bits (click one to flip it)

ClassreadwriteexecuteDigitReading
Owner7Owner can list its entries, create and remove entries and enter it and reach entries by name.
Group5Group can list its entries and enter it and reach entries by name.
Others0Others: nothing.

Worth a second look

  • noteset-group-ID on a directory: new entries inherit the directory's group, the usual setting for a shared project directory.

Commands that reach this mode

  • Absolute, octalchmod 2750 <path>
  • Absolute, symbolicchmod u=rwx,g=rxs,o= <path>
  • From the base, minimalchmod g+s,o-rx <path>

No umask creates this mode: the special bits never come from a umask.

Clause by clause, from 0755 under umask 022

ClauseClassesOpPermMode afterNotes
g+sg+s2755
o-rwxo-rwx2750

The calculator knows the mode bits, not the file system: it cannot see ownership, access control lists, capabilities, mount options or the mandatory access control that may override these bits. The GNU-specific behaviours (a directory keeping setuid and setgid under a numeric mode; =755, +x and -w with a number) are modelled as chmod(1) from coreutils 9.11 describes them; other implementations may differ.

API endpointGEThttps://ronutz.com/api/v1/chmod-permission-calculatorDocumented, not served. Opens the specification.

Referanser