Chmod Calculator

A Unix file-permission calculator. Toggle read, write and execute for owner, group and others to get the octal mode (like 755) and the symbolic string (rwxr-xr-x), or type an octal number to see exactly which permissions it grants. Explains what each bit means and the common modes to reach for.

755rwxr-xr-xchmod 755 file
read (4)write (2)execute (1)
Owner
Group
Others

Unix permissions look cryptic but are just three bits, three times. Every file carries permissions for three classes of user — the owner, the group, and everyone else — and each class gets three switches: read, write, execute. That is nine switches total, which is exactly what rwxr-xr-x spells out, three characters per class.

The octal form is those switches as numbers. Within a class, read is worth 4, write 2, execute 1, and you add up the ones that are on: rwx = 7, r-x = 5, rw- = 6, r-- = 4. String the three classes together and 755 falls out — owner 7, group 5, others 5. Once you see it as addition, you stop memorising and start computing, which is what this tool makes visible in both directions.

The one subtlety worth internalising is the execute bit on directories. On a file it means “run this”; on a directory it means “you may enter and reach what’s inside.” That is why files are typically 644 and directories 755: strip execute from a directory and you lock people out of everything within, even files they could otherwise read. Beyond the everyday nine bits sit the special ones — setuid, setgid, the sticky bit — a leading digit that changes how programs run and who can delete shared files; handy to recognise, and, in the case of setuid, worth handling with care.

How it works

  • Toggle r/w/x for owner, group and others → octal + symbolic.
  • Type an octal mode (e.g. 640) to decode it back to rwx.
  • Explains the common modes: 644 files, 755 dirs/executables.
  • Read = 4, write = 2, execute = 1, summed per class.

Frequently asked questions

How does the octal permission number work?

Each of the three permission classes — owner, group, others — gets one octal digit built from three bits: read = 4, write = 2, execute = 1. You add the ones you want: read+write+execute = 7, read+execute = 5, read+write = 6, read-only = 4. So 755 means the owner has 7 (rwx) and group and others have 5 (r-x). The three digits, left to right, are always owner, group, others.

What is the difference between 644 and 755?

644 (rw-r--r--) is the standard for regular files: the owner can read and write, everyone else can only read. 755 (rwxr-xr-x) is the standard for directories and executables: the owner can read, write and execute (or enter), while others can read and execute but not modify. The key difference is the execute bit — on a file it means "run this program," and on a directory it means "may traverse into it."

What do the execute bit and directories have to do with each other?

On a file, execute (x) permits running it as a program or script. On a directory, the same bit means permission to enter the directory and access files inside it by name — without it, you cannot cd in or open a known file even if you can read the listing. That is why directories are almost always 755 or 700, not 644: dropping the execute bit on a directory locks people out of everything within it.

What about setuid, setgid and the sticky bit?

Those are a fourth, leading octal digit (as in 4755, 2755, 1777). setuid (4) makes an executable run as its owner, setgid (2) runs it as its group or makes new files in a directory inherit the group, and the sticky bit (1) on a shared directory like /tmp stops users deleting each other’s files. They are powerful and, in the case of setuid on the wrong binary, a real security risk — so this calculator focuses on the everyday three classes while it is worth knowing the special bits exist.