chmod Calculator

Tick who can read, write and run a file, or type the octal or ls -l form. All three stay in step, and you get the chmod command to paste.

How it works

Every file on Linux and macOS has three sets of permissions: one for its owner, one for its group, and one for everybody else. Each set says whether that class can read the file, write to it, and run it (for a folder, "run" means being allowed to enter it).

Each permission is one bit, and three bits make one octal digit: read is 4, write is 2 and run is 1. Add them up per class and you get the familiar three digits: 7 is 4+2+1, read, write and run; 5 is 4+1, read and run. So 755 means the owner can do everything and the rest can read and run. ls -l shows the same nine bits as letters: rwxr-xr-x.

A fourth, leading digit holds three special bits: setuid (4), setgid (2) and sticky (1). The tool shows them as s and t in the letters, the way ls does. Everything is worked out on this page; nothing is sent anywhere.

How to use it

  1. 1 Tick the boxes, or type a mode such as 755 or 4755, or the letters from ls -l such as -rwxr-xr-x. The other forms follow.
  2. 2 Tick a special bit if you need one. Most files do not.
  3. 3 Type the file name to get a command ready to paste, in number and letter form.
  4. 4 Change the umask to see what permissions new files and folders will start with.

Good to know

  • Scripts usually want 755 and private keys 600. SSH refuses a private key whose mode lets anyone else read it.
  • A folder needs x to be entered. A folder with r but no x lets you list names but not open anything inside it.
  • An upper-case S or T in ls -l means the special bit is set but the run bit under it is not, which is usually a mistake.
  • chmod 777 is almost never the right fix. It lets every user on the machine change the file.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

From rwxr-xr-x to 755, and why umask 033 is not 633

Permissions are easiest to read once you see them as twelve switches. The last nine are in three groups of three, for the owner, the group and everyone else, and each group is read, write and run in that order. ls -l prints a letter for each switch that is on and a dash for each that is off, so rwxr-xr-x says: owner has all three, group has read and run, others have read and run. That is the whole meaning; the number is a shorter way to write it.

To turn the letters into a number, give each switch in a group a value: read is 4, write is 2, run is 1. Then add up each group on its own. rwx is 4+2+1, which is 7. r-x is 4+0+1, which is 5. So rwxr-xr-x is 755. Going back is the same in reverse: 6 can only be 4+2, so a 6 is rw-, and 640 is rw-r-----, read and write for the owner, read for the group, nothing for anyone else. Each digit has exactly one way of being built from 4, 2 and 1, which is why octal is used here at all: one digit, one group.

The three special bits sit in front, as a fourth digit with the same 4, 2, 1 values: setuid, setgid and sticky. They have no letter of their own in ls, so they borrow the run slot. A set setuid bit turns the owner’s x into s, so 4755 prints as rwsr-xr-x. Setgid does the same in the group’s slot, and sticky shows as t in the others’ slot, so 1777, the mode of /tmp, prints as rwxrwxrwt. If the special bit is on but the run bit under it is off, ls uses a capital: 4644 prints as rwSr--r--. That capital is worth noticing, because a setuid file that cannot run is usually a mistake.

The umask is where the arithmetic catches people out. When a program creates a file it normally asks for 666, read and write for everyone, and for a folder 777. The umask then turns off the bits it names. With umask 022 the write bits for group and others go, and files come out 644 while folders come out 755. It is tempting to think of this as 666 minus 022, and here that happens to give the right answer. Try umask 033 instead. 666 minus 033 is 633, which would be rw--wx-wx, a strange mode that gives others write and run but not read. The real answer is 644. In bits, 666 is 110 110 110 and 033 is 000 011 011; the umask clears the bits it has set, and the run bits it names were never on in 666, so only the write bits go: 110 100 100, which is 644. The tool always works bit by bit, so it gets this right.

The command it gives comes in two forms. chmod 755 deploy.sh sets all twelve bits at once and is what most guides show. chmod u=rwx,g=rx,o=rx deploy.sh says the same thing in letters, which some people find easier to read in a script. Both replace every permission on the file; neither is a relative change such as chmod +x, which only adds a bit.

Some limits. This covers classic Unix permission bits. It does not show access control lists (the + at the end of some ls -l lines), SELinux labels or Windows permissions, all of which can allow or block access on top of these bits. And the umask section shows the defaults that programs get when they ask for 666 or 777; a program that asks for less, such as an SSH client writing a key as 600, gets less.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and run the file (7). The group and everybody else can read and run it but not change it (5 and 5). It is the usual mode for programs, scripts and public folders.

What are setuid, setgid and the sticky bit?

Setuid makes a program run as its owner rather than as whoever starts it; passwd uses it to edit a file only root can write. Setgid does the same with the group, and on a folder it makes new files inherit the folder’s group. The sticky bit on a folder lets people delete only their own files in it, which is why /tmp is 1777.

How does umask work?

A program creating a file usually asks for 666 (folders 777), and the umask takes bits away. With the common umask 022, new files get 644 and new folders 755. The umask can only remove permissions, never add them.

Can I subtract the umask from 666?

Only sometimes. The umask clears bits; it does not subtract. With 022 the two agree, but with 033, 666 minus 033 is 633, while the real answer is 644: the run bits that 033 would clear were never set in 666. This tool works it out bit by bit.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.