DevOps & Config

chmod / umask Calculator

Convert between symbolic and octal permissions and compute a umask.

  • Draft kept in this tabYour draft is kept in this tab's session storage and cleared when the tab closes.
  • Runs in your browserProcessing happens in this page. No application server receives your input.

Permissions

Permission bits (owner / group / other)

ClassRead (r)Write (w)Run bit (x)
Owner (u)
Group (g)
Other (o)

Special bits (setuid / setgid / sticky)

Resulting mode

Generated configuration is inert text and has not been validated against a live daemon, cluster, or host. Review every directive before deploying.

Enter an octal or symbolic mode to see its permissions.

Unix File Permissions and umask Reference

Unix file permissions fit in a single twelve-bit integer: three special bits (setuid 4000, setgid 2000, sticky 1000) above nine read/write/execute bits grouped by owner (u), group (g), and other (o).

Special Bit Overprinting

In ls -l symbolic notation, the three special bits overprint the execute columns rather than adding characters. Setuid and setgid replace x with s when execute is set, or capital S when execute is clear. The sticky bit replaces other execute with t or capital T.

Why umask 022 Produces 644 for Files and 755 for Directories

A umask is a subtractive bitmask (base & ~umask): it clears bits from whatever creation mode a program requests, and cannot grant execute permission. Standard file creation requests 0666 while directory creation requests 0777.

Limits and Scope

Permission bits only. No ACLs (getfacl), no extended attributes, no SELinux context, no chattr flags: all of which can make an operation fail on a file whose mode says it should succeed, and none of which is expressible in twelve bits. X (execute only if a directory or already executable) is applied under an explicit is-a-directory toggle, because its meaning depends on the target and the tool has no target. Symlink modes are ignored, since chmod follows them on Linux. umask here is the classic subtractive mask; the ACL-aware default mask a setfacl -d imposes is not modelled.

Diagnostic Rules

RuleSeverityFires when
CHMOD/world-writablewarningThe other-write bit is set without the sticky bit
CHMOD/setuid-no-execwarningSetuid or setgid set with the corresponding execute bit clear โ€” the S case
CHMOD/setuid-writableerrorSetuid set together with group- or other-write. That is a local privilege escalation, written out
CHMOD/no-owner-readinfoThe owner cannot read their own file. Legal, and almost never intended

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.