Unix Permission Calculator
chmod calculator: octal ↔ rwx, setuid/sticky, u+x style changes, umask and ls -l.
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
- GNU coreutils manual: File permissions (chmod modes) (GNU)
- POSIX chmod utility (The Open Group)
Use this tool in an app
These free programs for your browser have this tool built in, next to everything else the task needs.
-
Opsdeck Developer & ops workbench
One deck for CI failures, cron, traces, k8s events, API diffs, query plans and Terraform.
Related tools
- Unicode Inspector – Every code point with name, script and bytes, plus hidden characters and look-alikes.
How to use the Unix Permission Calculator
Convert chmod modes between octal, symbolic and ls -l notation, apply chmod expressions like u+x,g-w exactly as GNU chmod does, and work out umask defaults.
What it is for
chmod 755, rwxr-xr-x, drwxrwsr-t, umask 027: Unix permissions come in several notations, and the special bits (setuid, setgid, sticky) and capital letters (S, T, X) trip up even experienced admins. The Unix Permission Calculator accepts a mode in any of three forms: octal (644, 0755, 4755), symbolic (rwxr-xr-x) or a full ls -l string (drwxr-sr-x, even with a trailing macOS @). It shows you the others and what each class may do.
You can also apply a chmod expression such as u+x,g-w,o=r or a+X to that mode and see every clause step by step, following GNU coreutils rules. And you can enter a umask to see the default modes for new files and directories.
It's a calculator, not a security audit. It doesn't know about ACLs, SELinux or AppArmor labels, mount options like noexec, or file ownership, all of which can override what the mode bits say.
Worked example
Plain conversion: 755 → 0755 = -rwxr-xr-x. The owner can read, write and execute. Group and others can read and execute.
Applying chmod: mode 664, expression u+x,g-w,o=r:
| Clause | Before | After |
|---|---|---|
u+x | 0664 | 0764 |
g-w | 0764 | 0744 |
o=r | 0744 | 0744 |
The result is 0744 (rwxr--r--), with the equivalent command chmod 0744 <path>.
Shared directory with a umask: drwxrwsr-t with umask 027 → 3775. That's a directory with setgid (new files inherit the directory's group) and sticky (users can only delete their own files). The umask 0027 gives new files 0640 and new directories 0750.
Capital X and sticky on a file: rw-r----- with a+X,o+t → 1640 (rw-r----T). a+X changed nothing, because X only adds execute to directories or to files that already have an execute bit. o+t set the sticky bit. Because others have no execute permission, it shows as capital T. A warning notes that the sticky bit has no effect on regular files on Linux.
How to read the result
- octal / symbolic / lsString: the same mode in all three notations. The four-digit octal includes the special bits.
- special: setuid (4000), setgid (2000) and sticky (1000) as true/false.
- fileType: regular file or directory. This changes what r, w and x mean: for a directory, x means "may enter" and r means "may list".
- chmod.steps: the mode before and after each comma-separated clause.
- umask: default modes computed as 666 & ~umask for files and 777 & ~umask for directories.
Tips and common mistakes
- Lowercase
s/tmean the special bit and execute are set. UppercaseS/Tmean the special bit is set without execute, which is usually a mistake. - Use
a+X(capital) when fixing permissions recursively. Directories become enterable without making every regular file executable. +xwithout a who letter respects the umask, just like GNU chmod. Writea+xif you want all three classes regardless.- On directories, GNU chmod keeps setuid/setgid with a numeric mode of up to four digits. Only a five-digit form like
00755clears them. Tick directory to get this behaviour. chmod 777is rarely the answer. Fix ownership or group membership instead, and use setgid directories for shared folders.- A umask only limits what programs request. Many editors create files with 666 and compilers with 777, so umask 022 gives 644 and 755 respectively.
FAQ
What does 755 mean?
Owner read+write+execute (4+2+1 = 7), group read+execute (4+1 = 5), others read+execute (5). In symbolic form it's rwxr-xr-x, typical for programs and public directories.
What's the difference between 644 and 664?
With 664 the group may also write. Use 644 for files only the owner should change and 664 for files shared within a team group.
Why is there a capital T in my permissions?
The sticky bit is set but others have no execute permission. On directories that's usually unintended. On regular files the sticky bit has no effect on Linux.
What umask should I use?
022 is a common default (files 644, directories 755). 027 keeps others out completely (640 and 750). 002 suits shared group work (664 and 775).
Guide last updated:
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 nameunix_permission_calculator
Example request
curl -s -X POST https://unixpermissioncalculator.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"mode":"755"}'