🔑 Linux Chmod Permissions Calculator
Calculate Linux/Unix file permissions with interactive read, write, and execute checkboxes. Generates octal (755, 644) and symbolic permissions.
👤 Owner (User)
👥 Group
🌍 Public (Others)
What Linux Chmod Permissions Calculator Does
Unix file permissions are nine bits, arranged as three groups of three: read, write and execute, for the owner, the group, and everyone else. `chmod` sets them, either as a three-digit octal number or as symbolic text like `u+x`.
The octal form works because each permission triple is a binary number from 0 to 7. Read is worth 4, write 2, execute 1, and any combination is their sum — so 7 is all three, 5 is read plus execute, 6 is read plus write. Once you see 755 as 4+2+1, 4+0+1, 4+0+1, the notation stops being arbitrary.
This calculator converts between octal, symbolic and the `ls -l` display, including the setuid, setgid and sticky bits that occupy a fourth leading digit.
How to Use Linux Chmod Permissions Calculator
- Click a preset (755, 644, 777, 600) or check individual r/w/x boxes for Owner, Group, and Others
- View the resulting 3-digit octal number and symbolic string
- Copy the ready-to-run `chmod` terminal command
Formula Used by Linux Chmod Permissions Calculator
Octal permission value
digit = 4×r + 2×w + 1×x
- r
- Read — 1 if granted, 0 if not
- w
- Write — 1 if granted, 0 if not
- x
- Execute (or, for a directory, "may enter")
Worked example
A file that should be readable, writable and executable by its owner, and read plus execute for everyone else.
- Owner: r+w+x = 4 + 2 + 1 = 7
- Group: r+x = 4 + 0 + 1 = 5
- Other: r+x = 4 + 0 + 1 = 5
Result: chmod 755 — displayed by ls -l as rwxr-xr-x. The standard mode for an executable or a directory.
Default mode from umask
effective = base AND NOT umask
- base
- 666 for new files, 777 for new directories — the OS never sets execute on a new file
- umask
- Bits to strip, commonly 022 or 002
Worked example
A new file created with the common umask of 022.
- Base for a file: 666
- Strip umask bits: 666 AND NOT 022
Result: 644 — rw-r--r--. The same umask applied to a new directory gives 777 − 022 = 755.
Octal Digit Reference
| Octal | Binary | Symbolic | Meaning |
|---|---|---|---|
| 0 | 000 | --- | No access |
| 1 | 001 | --x | Execute only |
| 2 | 010 | -w- | Write only |
| 3 | 011 | -wx | Write and execute |
| 4 | 100 | r-- | Read only |
| 5 | 101 | r-x | Read and execute |
| 6 | 110 | rw- | Read and write |
| 7 | 111 | rwx | Full access |
Modes You Will Actually Use
And the ones to avoid.
| Mode | ls -l | Typical use |
|---|---|---|
| 644 | rw-r--r-- | Normal file: owner edits, everyone reads |
| 600 | rw------- | Private file — SSH private keys, credentials |
| 755 | rwxr-xr-x | Directories and executables |
| 700 | rwx------ | Private directory, e.g. ~/.ssh |
| 775 | rwxrwxr-x | Shared group directory |
| 777 | rwxrwxrwx | Everyone can write and execute — almost never correct |
The Fourth Digit: Special Bits
Written before the three permission digits, as in 4755 or 1777.
| Value | Name | Effect |
|---|---|---|
| 4 | setuid | Executable runs as its owner rather than the caller. A classic privilege-escalation vector when misapplied |
| 2 | setgid | On a directory, new files inherit the directory's group — useful for shared project trees |
| 1 | sticky | In a shared directory, only a file's owner can delete it. This is why /tmp is 1777 |
Source: POSIX — chmod utility (The Open Group Base Specifications)
How to Read Your Result
Execute means something different on a directory
On a file, x means the file can be run. On a directory, x means you can traverse into it and access things by name. A directory with r but no x lets you list the names and read nothing; x without r lets you open a known path but not enumerate the contents. Directories almost always need x wherever they have r.
Why 777 is a red flag
It grants write and execute to every user on the system. Web tutorials suggest it as a fix for permission errors because it makes the symptom disappear, but on any multi-user or internet-facing machine it lets any account replace the file's contents. The correct fix is almost always to set the right owner and group, then use 755 or 644.
SSH is strict on purpose
OpenSSH refuses to use a private key that is readable by group or others, and will silently ignore an authorized_keys file in a world-writable directory. `~/.ssh` should be 700 and private keys 600. "Permissions 0644 for key are too open" is the client protecting you.
Limitations & Accuracy Notes
- These nine bits are the traditional Unix model. POSIX ACLs (`getfacl` / `setfacl`) can grant finer-grained access that `ls -l` only hints at with a trailing "+" on the mode string.
- SELinux and AppArmor apply mandatory access controls on top of file permissions. An operation can be denied by policy even when the mode allows it.
- Windows and most FAT/exFAT volumes do not implement this model. Modes shown on such a mount are synthesized by the mount options, not stored on disk.
- Root generally bypasses permission checks entirely, so a restrictive mode is not a protection against a privileged account.
Frequently Asked Questions
How are Linux chmod octal values calculated?
What is the difference between 755 and 644 permissions?
What do the three digits mean?
What does 755 mean?
What does 644 mean?
Why does a directory need the execute bit?
Is 777 ever the right answer?
What is the fourth digit some tools show?
References & Further Reading
- POSIX — chmod (The Open Group Base Specifications Issue 7) — The normative definition of the mode syntax and special bits