On Linux, macOS and other Unix-like systems every file and directory carries nine permission bits: read, write and execute for three classes of users – the owner, the owner’s group and everyone else. The chmod command (“change mode”) sets them, and it accepts two notations that you constantly need to translate between.
Octal notation packs each class into one digit by adding 4 for read, 2 for write and 1 for execute. 7 (4 + 2 + 1) means full access, 6 means read and write, 5 means read and execute and 4 read only. So chmod 755 lets the owner do everything and lets others read and run the file – the usual setting for scripts and web directories – while 644 is the norm for ordinary files and 600 for private keys.
Symbolic notation, the one ls -l shows, spells the same bits out as rwxr-xr-x. An optional fourth, leading octal digit adds the special bits: setuid (4) and setgid (2) make a program run with its owner’s or group’s privileges and show as s in the execute position, while the sticky bit (1) on a shared directory like /tmp stops users from deleting each other’s files and shows as t.
How to use the Chmod Calculator
- I want to
- Owner (user) permissions
- Group permissions
- Others (everyone else) permissions
- Special modes
- Octal permissions — 3 digits (e.g. 644) or 4 digits with special bits (e.g. 4755).
- Symbolic permissions — 9 characters like rw-r–r–, an ls -l string like drwxr-xr-x, or a mode like u=rw,g=r,o=r.
- File or directory name
- Apply to a directory’s contents too (-R)
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Choose to build a command from permission choices, decode an octal number, or decode a symbolic string. The calculator adds 4, 2 and 1 for each class, writes the octal digits, and spells out the symbolic, binary and ls -l forms with an explanation.
Worked example
The owner should read, write and execute (4 + 2 + 1 = 7), while the group and others should read and execute (4 + 1 = 5). The command is chmod 755 file_name, the symbolic form is rwxr-xr-x and the binary form is 111 101 101. Adding the setuid bit gives chmod 4755, shown as rwsr-xr-x.
Common permission sets
| Octal | Symbolic | Typical use |
|---|---|---|
| 644 | rw-r–r– | Regular files, web pages |
| 600 | rw——- | Private keys, secrets |
| 755 | rwxr-xr-x | Scripts, programs, directories |
| 700 | rwx—— | Private directories (~/.ssh) |
| 775 | rwxrwxr-x | Shared project directories |
| 1777 | rwxrwxrwt | /tmp and other shared drop folders |
Formula
read = 4 · write = 2 · execute = 1 · each digit = sum for one class (owner, group, others) · optional leading digit: setuid 4 + setgid 2 + sticky 1
Worked example
Inputs — I want to: Build a chmod command from permissions; Owner (user) permissions: rwx – read, write, execute (7); Group permissions: r-x – read, execute (5); Others (everyone else) permissions: r-x – read, execute (5); Special modes: None; File or directory name: file_name; Apply to a directory's contents too (-R): No.
Results — chmod command (octal) = chmod 755 file_name; chmod command (symbolic) = chmod u=rwx,g=rx,o=rx file_name; Octal = 755; Symbolic = rwxr-xr-x; As shown by ls -l (regular file) = -rwxr-xr-x; Binary = 111 101 101.
Key terms
- Octal mode
- Permissions written as digits 0–7, one per class: read 4 + write 2 + execute 1.
- Symbolic mode
- Permissions written with letters r, w, x (and s, t) for each class.
- setuid / setgid
- Special bits that run a program with the file owner's or group's identity.
- Sticky bit
- Special bit restricting deletion in shared directories.
Frequently asked questions
What does chmod 755 mean?
Owner: read, write and execute (7); group and others: read and execute (5). It is typical for scripts, programs and directories.
What does chmod 644 mean?
Owner can read and write; everyone else can only read. It is the default for ordinary files such as web pages.
Is chmod 777 safe?
Rarely – it lets every user modify or replace the file. Use 755 or 775 with the right group ownership instead.
What permissions should an SSH private key have?
600 (or 400): only the owner can read it. SSH refuses keys that others can read.
What does the s in rwsr-xr-x mean?
The setuid bit (chmod 4755): the program runs with its owner's privileges, like /usr/bin/passwd.
What is the sticky bit?
On a directory (chmod 1777, shown as t) only a file's owner can delete or rename it – used on /tmp.
What does execute mean for a directory?
Permission to enter it and access files inside; read lets you list its names.