Chmod Calculator
Calculate Unix file permissions visually. Convert between octal (755) and symbolic (rwxr-xr-x) modes, build chmod commands and check umask results.
PERMISSIONS:
| Read (r=4) | Write (w=2) | Execute (x=1) | Σ | |
|---|---|---|---|---|
| Owner (user) | 0 | |||
| Group | 0 | |||
| Others (world) | 0 |
SPECIAL BITS:
COMMON PRESETS:
WHAT THIS MEANS:
Examples: u+x, go-w, a=r, u=rwx,g=rx,o= (without a class letter, all classes change).
New files: 644 New directories: 755
Two-Way Sync
Tick the boxes, type an octal mode or paste an ls-style string such as -rwxr-xr-x. Every field updates instantly.
Special Bits & umask
Handles setuid, setgid and the sticky bit, builds ready-to-copy chmod commands and works out default modes from a umask.
chmod Expressions
Apply expressions like u+x,go-w the way chmod does and see the resulting mode. Everything runs locally in your browser.
>> technical info
How chmod Modes Work:
A Unix mode is a set of bits: read (4), write (2) and execute (1) for the owner, the group and everyone else. Add the values within each class to get one octal digit, so rwxr-xr-x is 7, 5, 5 = 755. An optional fourth leading digit holds setuid (4), setgid (2) and the sticky bit (1).
Example:
755 = rwxr-xr-x = u=rwx,g=rx,o=rx 644 = rw-r--r-- = u=rw,g=r,o=r 4755 = rwsr-xr-x (setuid)
Why Use a chmod Calculator:
- >Stop guessing octal digits when setting file permissions
- >Translate between numeric and symbolic modes in either direction
- >Spot risky settings such as world-writable files or setuid programs
- >Find the right umask for the default permissions of new files
>> frequently asked questions
Q: What does chmod 755 mean?
A: The owner can read, write and execute (7 = 4+2+1); the group and everyone else can read and execute (5 = 4+1). It is the usual mode for scripts, programs and public directories.
Q: What does chmod 644 mean?
A: The owner can read and write (6); the group and everyone else can only read (4). It is the typical mode for ordinary files such as HTML pages and configuration files.
Q: Is chmod 777 safe?
A: No. 777 lets every user on the system read, write and execute the file, which is rarely necessary and a security risk. Prefer 755 for programs and directories, 644 for files, or 775 and 664 when a trusted group must be able to write.
Q: How do I calculate a chmod number?
A: Add r=4, w=2 and x=1 for each of owner, group and others. For example rw- is 4+2 = 6 and r-- is 4, so rw-r--r-- is 644. Tick the boxes above and the number is calculated for you.
Q: What are setuid, setgid and the sticky bit?
A: setuid (4000) runs an executable with its owner's privileges and setgid (2000) with its group's privileges; on directories, setgid makes new files inherit the group. The sticky bit (1000) on a directory lets only a file's owner delete it, as in /tmp. In ls they appear as s, s and t, or capital S and T when execute is not set.
Q: What is umask?
A: The umask removes permissions from newly created files and directories. Files start from 666 and directories from 777, then the umask bits are subtracted: umask 022 gives files 644 and directories 755, while umask 077 gives 600 and 700.
Other Languages
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Check octal permissions, special bits and zero-padding, rejecting invalid modes.
- Comparison reference
- Explicit Unix permission-bit/octal fixtures.
- Verification scope
- These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
-
chmod-calculator.test.js
- parseOctal accepts 3 and 4 digit octal modes only
- toOctal pads and only shows the special digit when needed
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.