EasyUnitConverter.com

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.

readwriteexecute
Owner
Group
Others

Numeric (Octal)

755

Symbolic

rwxr-xr-x

$ chmod 755 filename
$ chmod u=rwx,g=rx,o=rx filename

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

NumericSymbolicDescriptionUse Case
777rwxrwxrwxFull access for everyoneTemporary testing only
755rwxr-xr-xOwner full, others read+executeExecutable scripts, directories
750rwxr-x---Owner full, group read+executeGroup-shared executables
700rwx------Owner full, no one elsePrivate scripts, SSH keys dir
666rw-rw-rw-Read+write for everyoneShared data files (rare)
644rw-r--r--Owner read+write, others readRegular files, HTML, configs
640rw-r-----Owner read+write, group readGroup-readable configs
600rw-------Owner read+write onlySSH private keys, secrets
555r-xr-xr-xRead+execute for everyoneRead-only executables
444r--r--r--Read-only for everyoneProtected config files
400r--------Owner read onlySSH 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.

Related Converters: