# Unix Permission Calculator > chmod calculator: octal ↔ rwx, setuid/sticky, u+x style changes, umask and ls -l. 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. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://unixpermissioncalculator.usefulweb.site/ (interactive tool at https://unixpermissioncalculator.usefulweb.site/tool) - JSON API: POST https://unixpermissioncalculator.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://unixpermissioncalculator.usefulweb.site/api/v1/tool) - OpenAPI: https://unixpermissioncalculator.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://unixpermissioncalculator.usefulweb.site/mcp - tool `unix_permission_calculator` ## Inputs - mode (text, required): Mode - Octal (644, 0755, 4755), symbolic (rwxr-xr-x) or an ls -l string (drwxr-sr-x, -rw-r--r--@). - chmod (text): chmod expression to apply (optional) - Symbolic clauses (u+x, go-w, a=rX, g=u, u+s, +t) or a numeric mode, applied to the mode above. - isDirectory (boolean): It is a directory - 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. - umask (text): umask (optional) - Shows the default modes for new files (666 & ~umask) and directories (777 & ~umask). ## Method - 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).