Chmod Calculator — Unix File Permissions
Calculate Unix/Linux file permissions in numeric (octal) and symbolic notation. Toggle checkboxes or enter a numeric value. See also Octal to Decimal and Binary to Octal.
| read | write | execute | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Others |
Numeric (Octal)
755
Symbolic
rwxr-xr-x
$ chmod 755 filename$ chmod u=rwx,g=rx,o=rx filenameHow Unix File Permissions Work
Numeric
755
Symbolic
rwxr-xr-x
How Unix File Permissions Work
Every file and directory in Unix/Linux has three sets of permissions: one for the owner (user who created the file), one for the group (users in the file's group), and one for others (everyone else). Each set has three permission types: read (view contents), write (modify contents), and execute (run as a program or enter a directory).
How to Calculate Chmod Values
Each permission has a numeric value: read = 4, write = 2, execute = 1. Add the values for each role to get a single octal digit. Combine the three digits for the full permission.
Formula
Permission digit = (read ? 4 : 0) + (write ? 2 : 0) + (execute ? 1 : 0)
Chmod value = [owner_digit][group_digit][others_digit]
Example
Owner: read + write + execute = 4 + 2 + 1 = 7
Group: read + execute = 4 + 0 + 1 = 5
Others: read + execute = 4 + 0 + 1 = 5
Result: 755 (rwxr-xr-x)
Common Chmod Values
| Numeric | Symbolic | Description | Use Case |
|---|---|---|---|
| 777 | rwxrwxrwx | Full access for everyone | Temporary testing only |
| 755 | rwxr-xr-x | Owner full, others read+execute | Executable scripts, directories |
| 750 | rwxr-x--- | Owner full, group read+execute | Group-shared executables |
| 700 | rwx------ | Owner full, no one else | Private scripts, SSH keys dir |
| 666 | rw-rw-rw- | Read+write for everyone | Shared data files (rare) |
| 644 | rw-r--r-- | Owner read+write, others read | Regular files, HTML, configs |
| 640 | rw-r----- | Owner read+write, group read | Group-readable configs |
| 600 | rw------- | Owner read+write only | SSH private keys, secrets |
| 555 | r-xr-xr-x | Read+execute for everyone | Read-only executables |
| 444 | r--r--r-- | Read-only for everyone | Protected config files |
| 400 | r-------- | Owner read only | SSH private keys (strict) |
Symbolic vs. Numeric Notation
Numeric (octal): Three digits, each 0-7. Quick to type: chmod 755 file. Sets all permissions at once.
Symbolic: Uses letters (u=user/owner, g=group, o=others, a=all) with operators (+, -, =) and permission letters (r, w, x). More readable and can modify individual permissions: chmod u+x file adds execute for the owner without changing other permissions.
Technical Details
Unix permissions are stored as a 12-bit value in the file's inode. The lower 9 bits are the standard rwx permissions (3 bits × 3 roles). The upper 3 bits are special permissions: setuid (4000) — execute as file owner, setgid (2000) — execute as file group or inherit group on directories, and sticky bit (1000) — only the owner can delete files in the directory (used on /tmp). The ls -l command shows permissions as a 10-character string: the first character is the file type (d for directory, - for regular file), followed by 9 permission characters.
Frequently Asked Questions
What does chmod 777 mean?
It gives read, write, and execute permissions to everyone (owner, group, and others). This is generally insecure and should only be used temporarily for debugging. For web files, 755 (directories) and 644 (files) are standard.
What permissions should SSH keys have?
Private keys should be 600 (rw-------) or 400 (r--------). The ~/.ssh directory should be 700 (rwx------). SSH will refuse to use keys with overly permissive settings.
How do directory permissions differ from file permissions?
For directories: read means listing contents, write means creating/deleting files inside, and execute means entering the directory (cd). A directory needs execute permission for anyone to access files within it, even if those files have read permission.
What is the umask?
The umask is a mask that removes permissions from newly created files. A umask of 022 means new files get 644 (666 - 022) and new directories get 755 (777 - 022). Check your umask with the umask command.