chmod Calculator

Unix permission calculator — octal ↔ symbolic and visual formats

Read

Write

Execute

Owner

Group

Other

Octal

chmod 644 file.txt

Symbolic

-rw-r--r--

Common Presets

About the chmod Calculator

This chmod calculator converts between permission checkboxes and the octal number Unix expects. Tick read, write and execute for owner, group and others to get the number, or enter 644 to see precisely what it allows.

A chmod calculator saves working out the arithmetic each time. Permissions come in three groups — owner, group and others — and each has three bits: read is 4, write is 2, execute is 1. Add them per group and you get one digit, so read plus write is 6.

That gives the familiar values. 644 means the owner can read and write while everyone else can only read, which is right for a normal file. 755 adds execute for everyone, which is what a directory or script needs. 600 restricts a file to its owner entirely, which is what SSH requires of a private key.

Execute on a directory means something different from execute on a file: it grants the right to enter the directory and access things inside, which is why a directory with 644 appears unusable even though it is readable. And 777 grants everything to everyone — almost never the right answer, however often it is suggested.

How to use the chmod Calculator

  1. Tick the permissions. Set read, write and execute for owner, group and others.
  2. Read the octal number. The three-digit value updates as you tick.
  3. Or enter a number. Type 755 or 644 to see exactly what it permits.
  4. Copy the command. Take the chmod value for your terminal.

chmod Calculator features

  • Tick read, write and execute for owner, group and others
  • Octal number and symbolic notation shown together
  • Enter an octal value to see what it permits
  • Presets for 777, 755, 644, 600, 400 and 000
  • Copy the result

Frequently asked questions

How does the octal number work?

Each digit is one audience — owner, group, others — and each is the sum of read (4), write (2) and execute (1). So 6 is read plus write, 7 is all three, and 644 means the owner can read and write while everyone else can only read.

Which permissions should I actually use?

644 for ordinary files and 755 for directories and executables, which is the sane default pair. 600 for anything containing secrets, such as a private key or an environment file. 777 is almost never right.

Why is 777 a bad idea?

Because it lets any user on the system modify the file, including a compromised web process. It is a common way to make a permissions error disappear, and it replaces a small problem with a much larger one.

Why does a directory need execute permission?

Because on a directory, execute means the right to traverse into it. A directory with read but not execute lets you list the names inside and not open any of them, which produces confusing errors.

Does it handle setuid and the sticky bit?

No — this covers the standard three-digit permissions only. The special bits are a fourth leading digit and are not calculated here.