Chmod Calculator
Work out Unix file permissions as numbers like 755 or letters like rwxr-xr-x, and see what they allow.
Loading Chmod Calculator… If nothing happens, please enable JavaScript.
Every file and directory on Linux, macOS and other Unix-like systems carries three sets of permissions: one for its owner, one for its group and one for everyone else. Each set can allow reading, writing and executing, and chmod is the command that changes them. This calculator shows the same permissions in all the forms you meet in practice. Tick the boxes in the grid, type a number such as 644 or 2775, or paste the letters from ls -l such as drwxr-sr-x, and the other two forms update instantly. Below them you get ready-to-copy chmod commands in both numeric and symbolic form (chmod 755 file and chmod u=rwx,g=rx,o=rx file), with an optional file name and a recursive -R switch.
Frequently asked questions
What does chmod 755 mean?
What is the difference between 644 and 755?
What do s, S, t and T mean in the permission string?
What do setuid, setgid and the sticky bit do?
Why should I avoid chmod 777?
How do I set different permissions for files and directories recursively?
What is a umask?
Does chmod 755 on a directory clear its setgid bit?
About Chmod Calculator
The numbers are octal: each digit is the sum of read (4), write (2) and execute (1) for one class, so 7 means all three, 6 means read and write, 5 means read and execute and 4 means read only. A fourth digit in front holds the special bits: 4 for setuid, 2 for setgid and 1 for the sticky bit. In the letter form these appear in the execute slots as s or t, and as a capital S or T when the special bit is set without the execute permission underneath it. The calculator understands all of these, and the explanation panel spells out in plain English what the owner, the group and everyone else can actually do. Switch between File and Directory, because the same bits mean different things: on a directory, read lets you list names, write lets you create and delete files, and execute lets you enter it and reach the files inside.
The common presets cover everyday cases: 644 for ordinary files, 755 for scripts and directories, 600 and 700 for private keys and folders, 664 and 775 for group collaboration, 400 for read-only secrets and 1777 for shared temporary directories. The tool warns when a mode is risky, for example 777, world-writable directories without the sticky bit or a writable setuid program. There is also a umask calculator: enter a umask such as 022 or 077 and see the permissions new files (starting from 666) and new directories (starting from 777) will get. Everything is calculated in your browser.
The sticky bit once kept programs in memory
The sticky bit got its name in early Unix, long before it had anything to do with shared directories. On a program file, it told the system to keep the program's text in swap space after it finished running, so frequently used commands such as the editor or the shell would start faster next time. The program was said to stick around.
As virtual memory and page caches improved, that trick stopped being useful and most systems began ignoring the bit on files. In the 1980s it was given a new job on directories: only the owner of a file may delete or rename it, even when the directory is writable by everyone. That is the meaning it has today, and the reason every Linux and macOS system shows a t at the end of drwxrwxrwt for /tmp.