Skip to content
🔐

Chmod Calculator

Convert Unix file permissions between octal and symbolic form.

Runs in your browser

Updated

Common permissions

Commands

chmod 755 file.txt

Breakdown

WhoReadWriteExecuteDigit

Bit meaning

4

read

2

write

1

execute

Read is 4, write is 2, execute is 1, and the three add together per group: read plus write is 6, so rw- is 6. 644 is the safe default for a file and 755 for a folder or script. 777 grants everyone full control and is almost never what you want.

Octal and symbolic permission strings

Two fields drive the whole page and are kept in step. Type an octal mode up to four digits and the symbolic box, the breakdown table and the command block rewrite themselves; edit the nine-character symbolic string and the octal field follows. The bit weights are fixed and stated on screen: read is 4, write is 2, execute is 1, summed separately for owner, group and other.

A worked example

The default 755 renders as rwxr-xr-x, and the table shows owner 7 with read, write and execute all on; group 5 with read and execute but no write; other 5 the same. The command panel prints two ready-made lines, chmod 755 file.txt and chmod -R 755 folder/, and the status note confirms a sensible least-privilege set.

Reading the four-digit form

A leading digit switches on special bits: 4 for setuid, 2 for setgid and 1 for the sticky bit, and those flags also appear as s or t in the symbolic string. When a special digit is present the note explains what it does, and setuid carries a warning to use it only on a program you trust. Seven preset buttons cover 644, 755, 600, 700, 664, 775 and 777. After setting permissions, keep stray files out of a repository with a gitignore generator and prove a transferred archive arrived intact using a file checksum verifier.

Where it stops

  • Octal input must match digits 0 to 7, at most four of them, or an error names the offending string.
  • Symbolic input must be exactly nine characters from r, w, x, s, t or dash, so ACL entries and long option lists are out of scope.
  • It only prints commands; nothing here touches a filesystem or a remote server.
  • Shared hosting often strips setuid, so a valid mode may still be refused by the host.
  • The 777 preset raises an explicit warning rather than a recommendation, because world-writable is rarely intended.

Questions people ask

Which mode should an uploaded PHP file use?

644 for content and 755 where execution is genuinely needed; never 777.

What does the sticky bit change?

Only on directories, where it stops one user deleting another user's files.

Why is 6 the pair rw?

Read four plus write two totals six, so rw- is always digit 6.