Convert chmod numeric modes to symbolic permissions and back
Quick answer: chmod numbers are sums of read (4), write (2) and execute (1) for owner, group and others. 755 = rwxr-xr-x (owner does everything, everyone else reads and runs), 644 = rw-r--r-- (owner writes, everyone reads), 600 = rw------- (owner only). Toggle the boxes below or type a mode to get the exact chmod command.
chmod 755 file.txt
| Command | Symbolic | What it grants | Typical use |
|---|---|---|---|
chmod 777 | rwxrwxrwx | Everything to everyone (risky) | Throwaway scratch dirs only |
chmod 755 | rwxr-xr-x | Owner full; group/others read + run | Directories, shared programs |
chmod 700 | rwx------ | Owner full; nobody else anything | Private dirs like ~/.ssh |
chmod 644 | rw-r--r-- | Owner read/write; others read-only | Regular files, web pages, configs |
chmod 640 | rw-r----- | Owner read/write; group read-only | Files shared with a service group |
chmod 600 | rw------- | Owner read/write only | SSH keys, .env secrets |
chmod 666 | rw-rw-rw- | Everyone can read and write | Shared logs (prefer group perms) |
chmod 444 | r--r--r-- | Read-only for everyone | Locking files against edits |
chmod 711 | rwx--x--x | Owner full; others may enter, not list | Public dirs with private contents |
chmod 4755 | rwsr-xr-x | 755 + setuid: runs as file owner | /usr/bin/passwd, sudo binaries |
chmod 2775 | rwxrwsr-x | 775 + setgid dir: group inherits | Team project directories |
chmod 1777 | rwxrwxrwt | 777 + sticky: delete own files only | /tmp, shared upload dirs |
A lowercase s or t means the special bit is set and execute is on; uppercase S or T means the special bit is set without execute, which is usually a mistake on programs.
Unix permissions are three triads of flags, one each for the file's owner (user), its group, and everyone else. Each triod is written either symbolically (rwx) or as an octal digit where read counts 4, write counts 2, and execute counts 1. This calculator keeps a checkbox grid, the numeric mode, and the symbolic string in sync, then hands you the exact command to run.
Digit = (read ? 4 : 0) + (write ? 2 : 0) + (execute ? 1 : 0), applied to owner, group, others in that order. A fourth leading digit works the same way for special bits: setuid 4, setgid 2, sticky 1, so 4755 splits into 4 (setuid) + 7 + 5 + 5. Going the other direction, each octal digit maps back to its bits: 7 is rwx, 6 is rw-, 5 is r-x, 4 is r--.
Type a mode like 640 into the numeric box and watch the grid and symbolic string update. Or click the checkboxes to build the permission you want and copy the finished command. The three special-bit checkboxes prepend the fourth digit. The command uses file.txt as a placeholder; swap in your path.
Take chmod 644, the standard mode for ordinary files. The owner digit 6 = 4 + 2, so read and write, no execute: rw-. Group and others get 4, plain read: r-- each. Full string rw-r--r--. Now chmod 755: owner 7 = 4+2+1 (rwx), group and others 5 = 4+1 (r-x), giving rwxr-xr-x, the usual choice for directories and scripts others should run but not edit.
Special bits follow the same arithmetic. /tmp runs 1777: everyone can create files (777), and the sticky 1 restricts deletion to each file's owner. A shared team directory at 2775 adds setgid so every new file inherits the directory's group instead of the creator's, keeping collaboration tidy without constant chgrp calls.
chmod 755 gives the owner read, write and execute (7 = 4+2+1), while group and everyone else get read and execute only (5 = 4+1). It's the default for directories and executable programs you want others to run: rwxr-xr-x.
chmod 644 gives the owner read and write (6 = 4+2), while group and others get read-only (4). The result, rw-r--r--, is the standard permission for regular files like configs, HTML pages and source code. Nobody but the owner can modify the file.
Each digit is a sum: read is 4, write is 2, execute is 1. So 7 means read+write+execute, 6 means read+write, 5 means read+execute, and 4 means read-only. The three digits apply to owner, group, and others in that order. A fourth leading digit sets special bits: setuid 4, setgid 2, sticky 1.
chmod 600 means read and write for the owner, no access at all for group or others (rw-------). Use it for private files like SSH keys (~/.ssh/id_ed25519), .env files with API secrets, and any credential file. SSH refuses to use a private key that group or others can read.
They're the optional fourth digit. Setuid (4) runs an executable as its owner, which is why /usr/bin/passwd can edit /etc/shadow as root. Setgid (2) on a program runs it as the file's group; on a directory, new files inherit the directory's group. Sticky (1) on a directory like /tmp (1777) lets everyone write but only delete their own files.
Almost never. 777 (rwxrwxrwx) lets every user on the system read, modify and execute the file or directory. It's a common quick fix for permission errors that instead opens the door to any local user or compromised process. Fix ownership or group membership instead, and reserve 777 for throwaway directories like test scratch space.