Chmod Calculator
| Class | Read (r) | Write (w) | Execute (x) |
|---|---|---|---|
| Owner | |||
| Group | |||
| Others |
Unix file permissions come in three triplets, read, write, execute for user, group, other, which collapse neatly into a three-digit octal number. chmod 755 script.sh is rwxr-xr-x: owner has everything, group and others have read and execute. This calculator lets you toggle each checkbox and see the octal flip live, or paste an octal number and see the rwx breakdown, with the exact chmod command ready to copy.
How chmod permissions work
-
1
Toggle the 9 permission bits
Three groups (user, group, other) × three permissions (read, write, execute) = 9 checkboxes.
-
2
Each group becomes one octal digit
Read = 4, write = 2, execute = 1. Sum the bits you want enabled.
-
3
Read the resulting octal and symbolic form
e.g. 755 → rwxr-xr-x; 644 → rw-r--r--; 600 → rw-------.
-
4
Copy the chmod command
The tool shows the chmod command for the current permissions, ready to copy. Examples: chmod 755 filename, chmod u+x filename, chmod -R 755 directory.
Permission bit values
| Bit | Value | Meaning for files | Meaning for directories |
|---|---|---|---|
| Read | 4 | Can view contents | Can list entries |
| Write | 2 | Can modify | Can create / delete / rename entries |
| Execute | 1 | Can run as a program | Can traverse (cd into, access inside) |
Common chmod values
| Octal | Symbolic | Typical use |
|---|---|---|
| 777 | rwxrwxrwx | World-writable, dangerous; rarely correct |
| 755 | rwxr-xr-x | Scripts, binaries, directories |
| 750 | rwxr-x--- | Scripts private to you and your group |
| 700 | rwx------ | Scripts private to you (SSH, ~/.ssh) |
| 644 | rw-r--r-- | Public documents, images, HTML |
| 640 | rw-r----- | Group-readable configs |
| 600 | rw------- | Private configs, SSH private keys, ~/.netrc |
| 444 | r--r--r-- | Read-only published files |
| 400 | r-------- | Private read-only (rarely correct; use 600) |
Special permissions (rare but important)
- setuid (4xxx): runs the file as its owner, regardless of who executes.
/usr/bin/passwduses this. - setgid (2xxx): on files, runs as the group. On directories, new files inherit the directory’s group.
- sticky bit (1xxx): on directories, only the file’s owner can delete/rename.
/tmpuses this.
Four-digit octals include these: chmod 4755 setuid-binary turns on setuid alongside 755.
Symbolic chmod
Many admins prefer symbolic form for incremental changes:
chmod u+x script, add execute for the owner only.chmod go-w file, remove write for group and other.chmod a+r file, give read to all (user, group, other).chmod u=rw,go=r file, set exactly these bits.chmod -R 755 directory, recursive.
Common mistakes
- 777 on uploads folders: seems to “fix permissions”; actually opens the server to attackers. Use a narrower combination (e.g. 755 with correct group ownership).
- chmod -R 644 on directories: removes execute on directories, so you can’t
cdinto them. Use 755 for directories, 644 for regular files. - 0600 vs 600: leading zero indicates octal in C and shell; most chmod implementations accept both.
- Umask: new files inherit 666 minus the umask. Default umask 022 gives 644 files and 755 directories.
Frequently Asked Questions
You typically want the owner to be able to modify, and everyone else to be able to list and traverse. 755 = rwx for owner, r-x for group and other, exactly that combination.
Almost never. 777 lets anyone on the system modify the file. In multi-user systems it’s a security hole; in single-user systems it’s unnecessary (the owner already has rwx with 755). If a web app seems to need 777, the real fix is correct ownership (chown) or group membership.
~/.ssh directory: 700. Private keys (id_rsa, id_ed25519): 600. Public keys (.pub): 644. authorized_keys: 600. SSH refuses keys with wider permissions as a safety measure.
chown for owner, chgrp for group, separate commands. chmod only changes bits, not the user/group owning the file.
Related Tools
HEX Color Picker
Pick or enter a HEX colour and get RGB, HSL, approximate CMYK, relative luminance and contrast ratios against white and black.
ASCII Table Reference
Full ASCII table from 0 to 127 with decimal, hex, octal, binary, standard names and HTML numeric-reference notation, including NUL, LF and DEL.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
JSON Formatter
Paste JSON to pretty-print with 2 or 4 spaces, minify it to compact output, or run a quick syntax check before copying the result.
Phone Validator
Validate phone numbers by country, detect the region and type, and normalize valid numbers to E.164, international, national and RFC 3966 formats.