HandyTools Hub

Chmod Calculator

Convert Unix permissions between octal, symbolic and chmod notation

ReadWriteExecute
Owner
Group
Other

Unix file permissions decide who may read, write, and execute a file, and they are usually written as three octal digits such as 755. This calculator lets you build a mode interactively or decode one you were given. Tick read, write, and execute for the owner, group, and other classes and it produces the octal string, the nine-character symbolic form used by ls -l, and the symbolic notation accepted by the chmod command. You can also type an octal value and watch the checkboxes update.

Reading the 3x3 Grid

The grid has one row per permission class and one column per permission bit:

ClassSymbolRead (4)Write (2)Execute (1)
Owneruown filesmodifyrun / traverse
Groupggroup filesmodifyrun / traverse
Otheroeveryonemodifyrun / traverse

Each digit is the sum of the bits that are checked for that row. The three-digit octal string is simply owner digit, then group digit, then other digit. The symbolic form replaces a set bit with its letter and a clear bit with a dash, so the three positions of each class always appear as rwx in that fixed order with dashes for anything missing.

When you inspect a file with ls -l, the mode appears as ten characters, for example -rwxr-xr-x. The first character is the file type, with a leading dash for a regular file and a d for a directory, and the remaining nine are exactly the symbolic string this tool produces. Reading that string is a matter of grouping it into threes, and each group maps straight back to one octal digit of the generated mode.

The Octal Digits

Because read is 4, write is 2, and execute is 1, every combination from 0 to 7 maps to exactly one permission triple:

DigitPermissionsSymbolic
0none---
1execute—x
2write-w-
3write + execute-wx
4readr—
5read + executer-x
6read + writerw-
7read + write + executerwx

Memorizing a few sums gets you most of the way: 6 is 4 + 2, 5 is 4 + 1, and 7 is all three.

Worked Examples

  • 644 - owner 6 = read + write, group 4 = read, other 4 = read. Symbolic rw-r--r--, chmod notation u=rw,g=r,o=r. The standard mode for web pages and configuration files that only the owner edits.
  • 755 - owner 7, group 5, other 5. Symbolic rwxr-xr-x, chmod notation u=rwx,g=rx,o=rx. The usual mode for directories, executables, and scripts.
  • 600 - owner 6, group 0, other 0. Symbolic rw-------, chmod notation u=rw,g=,o=. Common for private files such as .env, SSH private keys, and credential stores.
  • 700 - owner 7, group 0, other 0. Symbolic rwx------, chmod notation u=rwx,g=,o=. A private directory that only the owner may enter.
  • 777 - all bits set. Symbolic rwxrwxrwx, chmod notation u=rwx,g=rwx,o=rwx. Grants everyone full control and should be a last resort, not a default.

Typing an Octal Backwards

Instead of ticking boxes you can type the octal value into the input field, which is useful when you are decoding a mode from a manual or a server error. Input is limited to one to three digits, each 0 through 7. Short values are left-padded with zeros, so typing 7 is interpreted as 700 and 64 as 064. A digit of 8 or 9, four or more digits, or an empty value is rejected with an inline error rather than silently coerced.

What This Calculator Does Not Do

  • No special bits. Setuid (4), setgid (2), and the sticky bit (1) require a fourth leading digit, as in 4755 or 1777. This tool handles three digits only, so those modes cannot be entered.
  • No symbolic operator parsing. It displays u=rwx,g=rx,o=rx, but it does not understand chmod u+x or a+r. You have to translate the change to a full mode yourself.
  • No umask calculation. It shows an absolute mode, not the result of applying a umask to a default.
  • No filesystem access. Nothing is changed on disk; you still run chmod yourself.
  • No file/directory distinction. The same number is valid for both, but the practical meaning of the execute bit differs.

Common Mistakes

  • Setting 777 on web content. It lets any process or visitor modify files and is a common cause of compromised sites. Prefer 644 for files and 755 for directories.
  • Using 755 for regular files. That grants execute permission a document or image does not need, widening the attack surface.
  • Using 644 on a directory. Without the execute bit, the directory cannot be entered or traversed.
  • Forgetting the class order. The digits are owner, group, other, not other, group, owner.
  • Changing one file and ignoring the rest. Permissions are per file; after a deploy you may need chmod -R on a tree, applied deliberately.
  • Assuming a readable directory is enterable. Read and execute on a directory do different jobs.

Frequently Asked Questions

Why does the octal field reject 4755?

This calculator accepts one to three octal digits, and each digit must be 0 through 7, so it models the three standard permission classes (owner, group, other) only. A leading 4 is the setuid bit, which lives in a fourth digit position that this tool does not represent, so 4755 is treated as invalid input. The same applies to setgid (2) and the sticky bit (1).

What mode should a web directory have compared with a file?

Directories generally need the execute bit so they can be entered and traversed, which is why 755 is the common choice for folders and scripts. Ordinary web files only need to be read, so 644 is standard. Setting a regular file to 755 grants execute access it does not need, and setting a directory to 644 can make it impossible to open.

What is the difference between 644 and 664?

Both give the owner read and write and grant read to everyone. The only difference is the middle digit: 664 also grants write to the group, while 644 does not. Use 644 for files owned by a single user and 664 only when a trusted group genuinely needs to edit the file, such as a shared uploads directory.

Why do I need the x bit on a directory?

On a directory, read controls whether you can list its contents, while execute controls whether you can enter it or access files by name. Without x, commands like cd into the directory or opening a known file path fail even if the directory is readable. That is why directories are usually 755 or 700, never 644.

Which digit belongs to the owner, group, and other?

They read left to right: the first digit is the owner (the user class, shown as u in symbolic notation), the second is the group (g), and the third is everyone else (o). So in 755 the owner has rwx, the group has r-x, and other has r-x.

Does the calculator set permissions on my files?

No. It only computes and displays the octal and symbolic values. You still have to run the chmod command on your own machine or server, and you should understand what a mode grants before applying it, especially recursively.

Reviewed by the HandyTools Hub team · Last updated