// admin tools · 26
chmod calculator
Tick the boxes or type 755, rwxr-xr-x or u+x,go-w — octal, symbolic and ls -l forms stay in sync, with setuid, setgid, sticky and a umask calculator.
// runs locally — nothing is uploaded
| class | read 4 | write 2 | execute 1 | octal |
|---|---|---|---|---|
| owner u | 7 | |||
| group g | 5 | |||
| other o | 5 | |||
| special | 0 |
presets
commands
what it means
The kernel starts new files at 666 and directories at 777, then clears every bit set in the umask. That is why a fresh file is never executable, whatever the umask.
How it works
What it does
This calculator converts Unix file permissions between every form you meet in practice: the octal number you pass to chmod, the nine-character string ls -l prints, and the symbolic clauses such as u=rwx,g=rx,o=. Change any one and the others update. It also applies relative expressions like u+x,go-w to the current mode, explains what each class can actually do with a file versus a directory, and turns a umask into the default modes new files get. Everything runs locally in your browser.
How to use it
- Tick boxes in the grid, type an octal mode (
640,2775) or paste a permission string straight fromls -l, including the leading type character. - Choose file or directory — the same bits mean different things.
- Use the expression box to test a change before you run it:
go-won 775 shows 755. - Copy the octal or symbolic command. Paths with spaces are quoted for you.
What the bits mean
- r = 4
- File: read the contents. Directory: list the names inside.
- w = 2
- File: change the contents. Directory: create, rename and delete entries — even files you can't write to. It needs
xas well to work. - x = 1
- File: run it as a program. Directory: enter it and reach files by name.
- setuid = 4000
- An executable runs with its owner's privileges (
/usr/bin/passwdis 4755). Ignored on directories and, on Linux, on scripts. - setgid = 2000
- On a directory, new files inherit the directory's group — the standard fix for shared team folders. On a program, it runs with the file's group.
- sticky = 1000
- On a directory, only a file's owner (or root) may delete or rename it. That is why
/tmpis 1777.
In ls output a lowercase s or t means the special bit and execute are both set. Capital S or T means the special bit is set without execute, which is usually a mistake.
umask
A umask lists the bits to remove from new files (base 666) and directories (base 777). A umask of 022 gives 644 files and 755 directories; 027 gives 640 and 750. The umask -S form lists what is allowed instead, so u=rwx,g=rx,o= is the same as 027.
FAQ
Should I ever use chmod 777?
Almost never. It lets every account on the machine change or delete the file. When a web server can't write somewhere, fix the owner or group (chown, a shared group with 775 or 2775) instead.
What's the difference between chmod 755 and chmod u=rwx,go=rx?
Nothing — they set the same bits. Octal replaces the whole mode. Symbolic clauses with + or - change only the bits you name, which is safer across many files.
What does capital X do in chmod?
a+X adds execute only to directories and to files that already have an execute bit, so chmod -R a+rX makes a tree readable without making every file executable.
Why are my new files 644 when my umask is 022?
Programs ask for 666 on new files, and the umask removes 022. Execute is never added automatically; you add it with chmod +x.