chmod Calculator

Decode any Unix permission value without memorising the octal table. Enter 755 or rwxr-xr-x and the calculator shows the numeric value, the symbolic form and a plain-English breakdown of who can read, write and execute, including the setuid, setgid and sticky bits.

Permission value

Permission breakdown


            
            

Ready — paste some input or load the sample.

100% Client-Side · Privacy First. This tool runs entirely inside your browser. Nothing you type is uploaded, logged or sent to a server — you can even use it offline.

Overview

File permissions are stored as a small number of bits, and the two ways of writing them are just two views of the same thing. The octal form gives one digit per class, where 4 means read, 2 means write and 1 means execute, so 644 reads as read-write for the owner and read-only for everybody else. The symbolic form spells the same nine bits out as three groups of three letters, which is what ls -l shows you. A fourth octal digit carries the special bits: setuid is 4, setgid is 2 and the sticky bit is 1, giving 4755 for a setuid executable and 1777 for a sticky world-writable directory. This converter reads either form and prints the other one, together with a plain description of who can do what and whether the special bits are set. It also accepts a symbolic chmod expression such as u-w or g+s and resolves it to a numeric mode, which is the quickest way to answer what a script actually does.

How to use the chmod calculator

  1. 1Enter an octal mode such as 755, a symbolic mode such as rwxr-xr-x, or an expression such as u-w in the input panel.
  2. 2Read the octal and symbolic forms in the header of the output, which always show both directions of the same value.
  3. 3Check the breakdown of the owner, group and others permissions to see exactly which class holds which right.
  4. 4Confirm the three special bits at the bottom of the output before you apply the mode to a real file.
  5. 5Use the example values in the cheat sheet to sanity-check a mode you are not sure about before you apply it with chmod.
  6. 6Remember that the special bits live in a fourth digit, so a full mode such as 4755 has four digits and not three.

Cheat sheet

The syntax you will use most, and what each part does.

PatternWhat it means
644 rw-r--r-- — the owner may read and write, everybody else may only read.
755 rwxr-xr-x — the standard mode for a script or a directory that everyone traverses.
600 rw------- — readable only by the owner, the right default for a private key.
4755 rwsr-xr-x — setuid, so the program runs with the privileges of its owner.
1777 rwxrwxrwt — the sticky bit on a shared directory, where only the owner of a file may delete it.
u+s, g+s, o+t The symbolic way to set setuid, setgid and the sticky bit.

Common mistakes

The special bits are swapped.

Setuid is 4, setgid is 2 and the sticky bit is 1. Mixing them up turns a setuid binary into a setgid one, which is a very different thing.

A capital S or T appears.

A capital S means the special bit is set but the execute bit is not, and a capital T says the same for the sticky bit. That combination is unusual and worth investigating.

An expression gives a surprising result.

Expressions that only add or remove bits are resolved against a fully permissive 777 base, while an expression containing = starts from 000. That mirrors how a symbolic expression behaves when applied to a fresh mode.

A directory loses its execute bit.

Without the execute bit a directory cannot be entered or listed, so everything inside it becomes unreachable even though the files themselves still carry permissions.

Worked examples

A setuid binary

4755

The symbolic form rwsr-xr-x with setuid, setgid and sticky all listed as set or not set.

A symbolic expression

g+s

The numeric mode 2777, because setgid is added to a fully permissive base.

Frequently asked questions

Why is the sticky bit 1 and setuid 4?

The three special bits occupy their own digit, so they add to the ordinary rwx digits. Setuid is worth 4, setgid is worth 2 and the sticky bit is worth 1, which is why 4755 adds a leading four and 1777 a leading one.

What is the difference between 777 and 1777?

They grant exactly the same read, write and execute rights. The difference is the leading digit: 1777 also sets the sticky bit, which on a directory means that only the owner of a file can delete or rename it, even though everyone may write to the directory.

Does a setuid bit make a binary safe?

No. Setuid makes the program run with the privileges of the file owner, which is a classic privilege escalation target. It is only safe for a small, carefully audited program, and many systems refuse to honour it on scripts altogether.

Can I convert a full ls -l permission string?

Yes. Paste the ten character string that ls prints, for example -rwxr-xr-x, and the calculator strips the leading file type and returns the octal value along with the same symbolic form.

How do I remove one permission from an existing mode?

Use a symbolic expression such as u-w to remove write access from the owner, or o-x to remove execute from others. An equals sign sets the right explicitly instead of adding or removing it.

What does the capital S or T mean?

A capital S or T in the symbolic form means the special bit is set but the matching execute bit is missing. A lower case s or t means the special bit is set and execute is present as well.

Why do directories need the execute bit?

On a directory, execute means "may traverse into it" and read means "may list it". A directory with read but without execute cannot be opened, so the two bits almost always go together.

Which mode is the safe default for a web root?

Files at 644 and directories at 755 cover most static hosting needs, while 600 and 700 keep a private configuration directory readable only by the account that owns it.

How do I read the ten characters that ls prints?

The first character is the file type, the next three are the owner rights, then the group rights and then the others rights. The last three of those nine are the special bits when they are written in upper case.

Can two different expressions produce the same mode?

Yes, because a symbolic expression and an octal value are two ways of writing the same thing. The calculator always shows both, so you can check that the expression you wrote produces the mode you expected.

What does the umask have to do with this?

The umask is a set of bits that the system removes from the permissions you request. A file created with mode 666 and a umask of 022 ends up as 644, which is why a script often needs an explicit chmod.