Developer & data tools

Unix Permission Calculator

chmod calculator: octal ↔ rwx, setuid/sticky, u+x style changes, umask and ls -l.

Octal (644, 0755, 4755), symbolic (rwxr-xr-x) or an ls -l string (drwxr-sr-x, -rw-r--r--@).

Symbolic clauses (u+x, go-w, a=rX, g=u, u+s, +t) or a numeric mode, applied to the mode above.

Affects X, the meaning of r/w/x and GNU's handling of setuid/setgid on directories. ls -l strings starting with d set this automatically.

Shows the default modes for new files (666 & ~umask) and directories (777 & ~umask).

Try an example: 755 explained · Apply u+x,g-w,o=r to 664 · Parse ls -l "drwxrwsr-t" and umask 027 · a+X on a file without execute bits, then +t

How it works

Converts Unix file modes between octal (755, 4755), symbolic (rwxr-xr-x) and ls -l strings, explains what owner, group and others may do, applies chmod expressions such as u+x,g-w,o=r or a+X to a base mode exactly like GNU chmod, and computes default file and directory modes from a umask.

  • A mode has 12 bits: setuid (4000), setgid (2000), sticky (1000), then read (4), write (2) and execute (1) for owner, group and others. ls shows setuid/setgid as s in the execute position (S if execute is off) and the sticky bit as t (T).
  • chmod expressions follow GNU coreutils: clauses are separated by commas; who is any of u, g, o, a; operators + - =; permissions r w x X s t or a class to copy (g=u). X adds execute only for directories or when some execute bit is already set. s only affects u and g; t only affects o/a.
  • Without a who letter (e.g. +x), the bits masked by the umask are not changed, as in GNU chmod. For directories, GNU keeps setuid/setgid when you use = without s or a numeric mode of up to four digits; a fifth leading zero (00755) clears them.
  • umask: new files are created with 666 & ~umask and directories with 777 & ~umask (programs may request fewer bits).

Sources

For scripts and AI agents

  • JSON API: POST https://unixpermissioncalculator.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://unixpermissioncalculator.usefulweb.site/mcp · tool name unix_permission_calculator
Example request
curl -s -X POST https://unixpermissioncalculator.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"mode":"755"}'

Related tools

  • Unicode Inspector – Every code point with name, script and bytes, plus hidden characters and look-alikes.
Feedback