Chmod Calculator

Tick the boxes and get the octal number, the symbolic string and the chmod command you can paste into a terminal. It works both directions — type 644 and the boxes update. The special bits are included and, unlike most calculators, they are rendered correctly: setuid shows as a lowercase s when execute is set and a capital S when it is not, which is the signal that the bit is on a file that cannot run and is almost certainly wrong. The sticky bit gets the same treatment with t and T. Underneath, a plain-English line tells you who can do what, which is generally more useful than the number when you are deciding whether 777 is really what you want. Common modes are one click away, with notes on when each is appropriate.

Common modes

OctalSymbolicTypical use
644rw-r--r--Ordinary files — owner edits, everyone reads
755rwxr-xr-xDirectories and executables
600rw-------Private files, config with secrets
700rwx------Private directory or script
1777rwxrwxrwtShared writable directory like /tmp
777rwxrwxrwxAvoid — anyone can change or run it

When to use it

  1. Work out the octal for the permissions you actually want before running chmod.
  2. Read an ls -l string like -rwxr-xr-- and find out what number it corresponds to.
  3. Set up a web directory with correct permissions without guessing.
  4. Understand what 644, 755 or 600 mean, in words.
  5. Check what the sticky bit on /tmp is doing.

How to Use

  1. Tick read, write and execute for owner, group and others.
  2. Or type an octal number and let the boxes fill in.
  3. Copy the chmod command and run it.

Features

  1. Two-way conversion between octal and symbolic
  2. setuid, setgid and sticky bit support
  3. Correct capital S and T when execute is missing
  4. Ready-to-run chmod command
  5. Plain-English description of the result
  6. One-click common modes with guidance

FAQs

What do the numbers in chmod mean?

Each digit is three bits added together: read is 4, write is 2 and execute is 1. So 7 is all three, 6 is read and write, 5 is read and execute, 4 is read only. The three digits are owner, group and everyone else, in that order.

Should I ever use 777?

Almost never. It lets any user on the system read, change and run the file, which on a shared or internet-facing machine is how a small problem becomes a large one. If something only works at 777, the real fix is usually correcting the file's owner or group instead. 755 for directories and executables, 644 for ordinary files.

What is the difference between 644 and 755?

The execute bit. 644 is a normal file — the owner can edit it, everyone can read it. 755 adds execute for everyone, which a directory needs before anyone can enter it and a script needs before it can run. A plain text file at 755 is harmless but pointless.

Why does my symbolic output show a capital S or T?

Because the special bit is set but the matching execute bit is not. Lowercase s means setuid with execute; capital S means setuid without it, which is a file that cannot run carrying a bit that only affects running. It is nearly always a mistake. Capital T is the same situation for the sticky bit, which you will genuinely see on directories that lack execute for others.

What does the sticky bit actually do?

On a directory, it stops users deleting each other's files even when the directory is world-writable. That is why /tmp is 1777 — anyone can create a file there, but only the owner can remove theirs. On files, modern systems ignore it.

Does this change any file?

No. It calculates the number and gives you the command. Nothing on your machine is touched and nothing is uploaded — a web page cannot alter your filesystem.

Technical Details

Unix permissions are three bits each for owner, group and others — read is 4, write is 2, execute is 1 — which is why the familiar three-digit octal numbers work the way they do: 7 is all three, 6 is read and write, 5 is read and execute. Toggling a checkbox here sets a bit and the octal, the symbolic form and the chmod command are all recomputed from the same state, so the three can never disagree. The fourth leading digit holds setuid (4), setgid (2) and the sticky bit (1), and its representation in symbolic notation is where most calculators get it wrong: setuid replaces the owner's x with an s, but only when execute is actually set — when it is not, the character is a capital S, which signals a bit that is set on a file that cannot be executed and is almost always a mistake. The same distinction applies to setgid and to the sticky bit, whose T is the one you will see on a directory without execute for others. Both cases are handled. Typing an octal parses in the other direction, accepting three or four digits and rejecting a digit above 7, which is the usual typo. Everything is arithmetic on your device — nothing is uploaded, and no file is touched, since this computes a number for you to use rather than changing any permissions itself.

Developer Tools

Developer Tools

  • HTML to Markdown
  • Markdown Table Generator
  • JavaScript Beautifier
  • GraphQL Formatter
  • Prettier Playground
  • XML Formatter
  • cURL Command Builder
  • cURL to Code