Chmod Calculator - Linux File Permission Generator
Select read, write, and execute permissions for owner, group, and others to generate the octal value and symbolic notation instantly. Enter an octal value (like 755 or 644) in the Octal Input field to decode it back to checkboxes. The ready-to-paste chmod command updates live. Special bits (setuid, setgid, sticky) are fully supported.
What is chmod and how does it work?
chmod (short for "change mode") is the Unix and Linux command for setting the read, write, and execute permissions on files and directories. Every file has three permission groups: the owner (the user who created it), the group (a named set of users), and others (everyone else). For each group, three flags can be on or off: r (read), w (write), and x (execute). The nine flags together are expressed as either a three-digit octal number (0 to 7 per group) or a nine-character symbolic string like rwxr-xr-x. The octal form is more common in scripts because it is compact; the symbolic form is easier to read at a glance. This calculator converts instantly between the two and outputs a ready-to-paste command.
Understanding octal notation
Each permission group (owner, group, others) maps to one octal digit from 0 to 7. Because octal digits run from 0 to 7 and three binary bits also produce values from 0 to 7, each digit directly encodes the three flags: read = 4 (binary 100), write = 2 (binary 010), execute = 1 (binary 001). Add the values of the bits you want to get the digit for that group. For example, read + write = 4 + 2 = 6, which is rw-. Read + write + execute = 4 + 2 + 1 = 7, which is rwx. The three digits are written in order: owner, group, others. So 755 means owner rwx (7), group r-x (5), others r-x (5), the standard permission for executables and web directories.
Common chmod values explained
755 is the typical permission for directories and executables: the owner can read, write, and execute; group and others can read and execute but not write. 644 is standard for files: the owner can read and write, everyone else can only read. 600 restricts a file to the owner only (read and write, no access for group or others), good for private keys and configuration files with secrets. 777 gives full access to everyone and should almost never be used on a production system because it allows any user to modify or delete the file. 700 keeps a directory or program private to its owner. For web servers, the convention is 755 for directories and 644 for static files, which lets the web server process read everything while only the owner can edit.
Special permission bits: setuid, setgid, and sticky
A four-digit octal chmod adds a leading digit for the three special bits. Setuid (4) on an executable file causes it to run with the permissions of the file owner rather than the calling user. This is how programs like passwd can write to /etc/shadow even when run by a non-root user. Setgid (2) on a file does the same for the group; on a directory, it causes new files created inside to inherit the directory's group instead of the creating user's default group, which is useful for shared project directories. The sticky bit (1) on a directory prevents users other than the file owner and root from deleting or renaming files inside it, even if they have write permission on the directory. The /tmp directory on almost every Unix system is set sticky (1777) for exactly this reason. In the symbolic display, setuid replaces the owner execute slot with "s" (or "S" if execute is not also set), setgid replaces the group execute slot, and sticky replaces the others execute slot with "t" or "T".
Octal permission reference
| Octal digit | Binary | Symbolic | Meaning |
|---|---|---|---|
| 7 | 111 | rwx | Read, write, execute |
| 6 | 110 | rw- | Read and write |
| 5 | 101 | r-x | Read and execute |
| 4 | 100 | r-- | Read only |
| 3 | 011 | -wx | Write and execute |
| 2 | 010 | -w- | Write only |
| 1 | 001 | --x | Execute only |
| 0 | 000 | --- | No permissions |
Each octal digit maps to one set of three permission bits (read=4, write=2, execute=1).
Frequently asked questions
What does chmod 755 mean?
755 breaks down as: owner = 7 (rwx, full access), group = 5 (r-x, read and execute), others = 5 (r-x, read and execute). It is the standard permission for directories and executables. The owner can modify the file; everyone else can read and run it but cannot change it. For web servers, 755 on directories allows the server to traverse them, and 644 on files lets the server serve them without allowing public writes.
What is the difference between octal and symbolic chmod?
Octal chmod (e.g. chmod 644 file) replaces all nine permission bits at once using three digits. Symbolic chmod (e.g. chmod u+x file) modifies only the specified bits relative to the current state. Octal is faster for setting permissions from scratch; symbolic is safer when you want to add or remove one flag without changing the rest. This calculator generates both forms so you can choose whichever fits your workflow.
How do I make a file executable?
Run chmod +x filename to add execute permission for all users, or chmod u+x filename to add it only for the owner. In octal, if the file is currently 644 (rw-r--r--), making it executable for the owner gives 744 (rwxr--r--); making it executable for everyone gives 755 (rwxr-xr-x). Tick the Execute checkbox for the groups you want in this calculator to see the exact octal and command.
What does the sticky bit do?
The sticky bit (octal 1000) on a directory means that only the file's owner, the directory's owner, or root can delete or rename files inside, even if other users have write permission on the directory. The canonical example is /tmp (chmod 1777): all users can create files there, but nobody can delete someone else's files. In the symbolic display, a sticky directory shows "t" or "T" in the others execute slot.
What is setuid and when should I use it?
Setuid (4000) causes an executable file to run with the file owner's privileges rather than the calling user's. Linux uses it for programs that need elevated access for a specific task, such as passwd (which must write to /etc/shadow). Use setuid sparingly: any bug in a setuid program is a potential privilege-escalation vulnerability. Never set setuid on scripts, only on compiled binaries you fully trust, and always audit what the program does with those elevated privileges.
How do I apply permissions recursively?
Add the -R flag: chmod -R 755 /var/www/html applies 755 to the directory and every file and subdirectory inside it. Use with care: recursive chmod makes no distinction between files and directories, so a blanket chmod -R 755 sets execute on all files, which is often wrong for static files. A common pattern is to use find to apply different permissions to files and directories separately: find . -type d -exec chmod 755 {} + for directories and find . -type f -exec chmod 644 {} + for files.