Permissions calculator

Tick the boxes, or paste a value you found. Octal and symbolic in both directions, with the special bits handled properly, which is the part most calculators get wrong.

Bits

Result

Read a value you found

Type any of those forms and the boxes above update to match.

What each bit lets someone do

What this is actually doing

A Unix permission has three parts, one for the owner, one for the group and one for everyone else, and each part is three bits: read, write and execute. Four plus two plus one. That is why the octal digits only ever go up to seven, and why rwx is 7 and r-x is 5.

The ten character string you get from ls -l has one more character at the front, and it is not a permission at all. It is the file type: a dash for a regular file, a d for a directory, an l for a symlink. That is the single most common source of confusion here, and it is why chmod 755 and rwxr-xr-x are ten characters and three digits respectively.

Then there are the special bits, which live in a fourth octal digit in front. setuid on an executable makes it run as its owner rather than as whoever started it, which is how sudo works and also how privilege escalation usually happens. setgid does the same for the group, or, on a directory, makes new files inherit the directory's group. sticky on a directory means only a file's owner can delete it, which is the entire reason /tmp is not a free-for-all.

In symbolic form the special bits borrow the execute position, and this is the detail worth learning. A lowercase s means the special bit is set and execute is also set. An uppercase S means the special bit is set but execute is not, which on a file means it does nothing until you add execute. So rwsr-xr-x and rwSr-xr-x differ by one bit and mean quite different things. The same rule applies to the sticky bit, where t and T are the two cases.

Build it yourself

The same conversion with stat, chmod and a short script, including how to read a directory's permissions in bulk and the arithmetic behind the octal digits.

Read the lesson

Other utilities

Random passwords and Diceware passphrases, with an honest entropy figure.

Base64, Base64URL, hex, URL, ROT13, HTML entities and binary.

MD5, SHA-1 and the SHA-2 family, over text or a file, with a compare mode.

Read a token, check its claims, and actually verify the signature.

CIDR to network, broadcast, host range and host count, for v4 and v6.