Skip to content
Webmaster Tools
Dev utilitiesChmod Calculator

Chmod Calculator

Unix permissions, octal and symbolic.

Permissions

ClassReadWriteExecuteSpecialOctal
What the bits mean
Owner (u), group (g), others (o)
Every file has one owning user and one group. The kernel checks only the first class that matches you: the owner gets the owner bits, members of the group get the group bits, and everyone else gets the others bits. a means all three.
Read, write, execute on a file
r reads the contents, w changes them, x runs it as a program or script.
Read, write, execute on a directory
r lists the names inside, w creates, renames and deletes entries (with x), and x lets you enter it and reach files by name. A directory almost always needs x wherever it has r.
Special bits
setuid (4000) runs a program with its owner's privileges, as passwd does; Linux ignores it on scripts. setgid (2000) runs with the group's privileges, and on a directory makes new files inherit its group. Sticky (1000) on a directory lets only a file's owner delete it, as on /tmp. In symbolic form they replace the x: s/t with execute, S/T without.
Runs in your browser

About the Chmod Calculator

This calculator converts Unix file permissions between the checkbox grid (read, write and execute for owner, group and others), the octal number (755, or 4755 with special bits) and the symbolic string that ls -l prints (rwxr-xr-x). It also writes the matching chmod command in octal and symbolic form.

The setuid, setgid and sticky bits are supported. In the symbolic string they replace the execute position: s or t when execute is also set, S or T when it isn't.

How to use it

  1. Tick the checkboxes, type an octal or symbolic mode, or click a preset.
  2. To change the current mode, type a relative expression such as u+x,go-w or a=r and press Apply. A full command like chmod 750 deploy.sh works too.
  3. Tick "Directory" to see what the bits mean for a folder, then copy the command.

Examples

  • 755: the usual mode for programs, scripts and directories.
  • rwxr-xr--: parses the symbolic form, which is 754.
  • Setuid on 755: shows rwsr-xr-x, as on /usr/bin/passwd.

Common questions

What do the three digits mean?

Each digit is a sum: read is 4, write is 2 and execute is 1. The first digit is the owner, the second the group, the third everyone else, so 640 means owner read and write, group read, others nothing.

Why can't I open a directory that has read permission?

Listing names needs r, but entering the directory and opening files inside it needs x. Directories normally get 755 or 750, files 644 or 640.

Does chmod 755 clear setgid on a directory?

GNU chmod keeps a directory's setuid and setgid bits when you give a 3-digit mode. Use g-s or a 5-digit mode such as 00755 to clear them.