Chmod Calculator

Convert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation. Edit any one and the others update instantly.

Who Read (4) Write (2) Execute (1)
Owner
Group
Others
Special bits (setuid, setgid, sticky)
Presets:

How the numbers work

A Unix permission is three groups - owner, group, others - and each group has three switches: read, write and execute. Give each switch a value (read is 4, write is 2, execute is 1) and add up the ones that are on. That sum, 0 to 7, is one octal digit. Three digits describe the whole file: 755 is owner 7 (rwx), group 5 (r-x), others 5 (r-x). The symbolic form rwxr-xr-x spells out the same thing with letters, which is what ls -l prints.

The permissions you actually use

OctalSymbolicTypical use
644rw-r--r--Regular files: owner edits, others read
755rwxr-xr-xDirectories and executable scripts
600rw-------Private keys and secrets: owner only
700rwx------Private directories
777rwxrwxrwxAvoid: world-writable, a security hole

Special bits

A fourth leading digit sets the special bits. Setuid (4) runs an executable as its owner, setgid (2) runs it as its group or makes a directory hand its group to new files, and the sticky bit (1) on a shared directory like /tmp stops users deleting files they do not own. In symbolic form these replace the execute letter: 4755 shows as rwsr-xr-x and the classic 1777 on /tmp is rwxrwxrwt.

Working on a server? The cron expression generator helps with scheduled jobs and the URL parser breaks down endpoints you are debugging.

Frequently asked questions

How does octal map to rwx permissions?
Each digit is a sum of three values: read is 4, write is 2, execute is 1. Add the ones you want. 7 is 4+2+1 = rwx, 6 is 4+2 = rw-, 5 is 4+1 = r-x, 4 is r--. A permission like 755 means owner 7 (rwx), group 5 (r-x), others 5 (r-x).
What is the difference between 644 and 755?
644 (rw-r--r--) is the standard for regular files: the owner can read and write, everyone else can only read. 755 (rwxr-xr-x) adds the execute bit for everyone, which is what directories and scripts need - you cannot enter a directory or run a script without execute permission.
Why is 777 dangerous?
777 (rwxrwxrwx) lets any user on the system read, write and execute the file. On a shared or internet-facing server that means anyone can overwrite your code or replace a script with malware. It is almost never the right answer; 755 or 644 usually is. Fix the actual owner or group instead of opening a file to the world.
What are setuid, setgid and the sticky bit?
They are the special permission bits, shown as a fourth leading octal digit. Setuid (4) makes an executable run as its owner rather than the caller. Setgid (2) does the same for the group, or on a directory forces new files to inherit the group. The sticky bit (1) on a directory, like /tmp, stops users deleting each others files. In symbolic form they appear as s, s and t.
What does the s or t appear as in symbolic notation?
When a special bit is set, it replaces the execute character. Setuid shows as s in the owner execute slot (S if execute is off), setgid as s in the group slot, and the sticky bit as t in the others slot (T if execute is off). So 1777 is rwxrwxrwt and 4755 is rwsr-xr-x.