Chmod Calculator (Unix Permissions)
Tick read, write and execute for owner, group and others, or type 755, rwxr-xr-x or u=rwx,go=rx, and get the octal, symbolic and ls -l forms with ready-to-run chmod commands.
How to Use
- Tick the boxes for owner, group and others (read, write, execute), plus setuid, setgid or sticky if you need them.
- Or type any form into Mode:
755,4755,rwxr-xr-x, anls -lline such asdrwxrwxrwt, a wholechmod 644 filecommand, or clauses likeu+x,go-w. - Choose whether it is a file or a directory and, optionally, the file name to put in the commands.
- Copy the numeric or symbolic
chmodcommand from the output. - Switch to umask to see what modes new files and directories get, for example umask 022 → 644 and 755.
chmod 644 file
Worked Example
755 for a web directory. Each digit adds read (4), write (2) and execute (1):
owner: r + w + x = 4 + 2 + 1 = 7 → rwx
group: r + x = 4 + 0 + 1 = 5 → r-x
others: r + x = 4 + 0 + 1 = 5 → r-x
Together: rwxr-xr-x, and ls -l shows drwxr-xr-x for the directory.
2775 for a shared folder: the leading 2 is setgid, the rest is 775 (rwxrwxr-x). Because the group’s execute bit is set, setgid appears as a lower-case s in its place: rwxrwsr-x. 1777 on /tmp shows the sticky bit as t in the others’ execute place: rwxrwxrwt.
umask 022: new files are 666 AND NOT 022 = 644 (rw-r--r--), new directories 777 AND NOT 022 = 755 (rwxr-xr-x).
The common mistake: subtracting the umask. With umask 033, 666 − 033 looks like 633, but the umask only clears bits that are set: 6 AND NOT 3 is 4, so new files are really 644. The other classic is chmod -R 777 to make a permission error go away, which gives every account on the server write access to everything.
Show Work
Formulas
Where rwx Came From
Read, write and execute for the owner, the group and everyone else go back to the early Unix systems Ken Thompson and Dennis Ritchie built at Bell Labs in the 1970s. Three bits per class fit one octal digit, which is why permissions are still written in base 8. Ritchie invented the setuid bit so that ordinary users could run a program, such as the one that changes passwords, with the program owner’s rights; AT&T patented it (US patent 4,135,240, granted in 1979) and then released the patent to the public.
The sticky bit first meant “keep this program’s text in swap after it exits”, a speed-up for frequently used commands on small machines. Faster disks and virtual memory made that pointless, and BSD gave the bit its present meaning on directories: in a world-writable directory such as /tmp, only a file’s owner can delete or rename it. POSIX later standardised the octal and symbolic chmod notations used on Linux, the BSDs and macOS today.
About This Tool
This calculator converts Unix file permissions between checkboxes, three- or four-digit octal, the nine-letter symbolic form, the ls -l listing and both styles of chmod command. It reads any of those forms, including setuid, setgid and sticky letters and relative clauses such as go-w or a+X, which are applied to the current bits. The umask mode shows the modes new files and directories get.
It warns about world-writable modes, special bits that have no effect, and directories without execute. Everything runs in your browser and nothing is sent anywhere.
It suits anyone setting up a web server, SSH keys, shared folders or deployment scripts, and students learning how Unix permissions add up.
Related tools: Number Base Converter, .htaccess Generator, and Cron Expression Builder.
Frequently Asked Questions
What does chmod 755 mean?
Each digit is one class of user, and each is the sum of read (4), write (2) and execute (1). 7 = 4 + 2 + 1, so the owner can read, write and execute; 5 = 4 + 1, so the group and everyone else can read and execute but not change the file. Written symbolically that is rwxr-xr-x. It is the usual mode for directories and scripts; ordinary files are usually 644 (rw-r--r--).
Why is chmod 777 a bad idea?
The last 7 gives every account on the machine write access, including the web server’s user and any other site on a shared host. A single exploited script can then rewrite or plant files. Fix the owner or group instead (chown), and use 755/644, or 775/664 when a group needs to write.
What are setuid, setgid and the sticky bit?
They form a fourth, leading octal digit. setuid (4) runs a program with its owner’s rights: /usr/bin/passwd is 4755, shown as rwsr-xr-x. setgid (2) on a directory makes new files inherit its group: 2775 is rwxrwsr-x. The sticky bit (1) on a directory lets only a file’s owner delete it: /tmp is 1777, rwxrwxrwt. A capital S or T means the special bit is set without execute.
How does umask work?
The umask lists the permission bits to remove when something is created. Programs ask for 666 for files and 777 for directories, and the umask is cleared out of that: umask 022 gives 644 and 755, umask 077 gives 600 and 700, and umask 002 gives 664 and 775. It is a bitwise AND NOT, not a subtraction: umask 033 gives files 644, not 633.
Why can’t I open a directory set to 644?
On a directory, read lets you list the names and execute lets you enter it and reach the files inside. 644 has no execute bit, so cd fails and files cannot be opened even if their own mode allows it. Directories need 755 (or 750, 700). Beware chmod -R 644 on a folder; use chmod -R u=rwX,go=rX, where the capital X adds execute only to directories and files that already had it.
How do I use the Chmod Calculator (Unix Permissions)?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Web hosting
WordPress’s own guidance: directories 755, files 644, and wp-config.php 440 or 400 so other accounts cannot read the database password.
SSH keys
OpenSSH refuses a private key that others can read (“Permissions 0644 … are too open”). Use 600 for the key and 700 for ~/.ssh.
Making a script runnable
chmod +x deploy.sh turns 644 into 755 under the usual umask of 022; chmod u+x gives 744 instead.
A shared team folder
2775 plus a shared group: everyone in the group can write, and new files keep the folder’s group instead of each user’s own.
Reading ls -l output
Paste -rwsr-xr-x or drwxrwxrwt from a listing to get 4755 or 1777 and an explanation of each letter.
Last updated: