Chmod Calculator
Calculate Unix/Linux file permissions — toggle visually, get octal and symbolic notation, generate the chmod command. 100% client-side.
chmod 755 file.txt
⚡ Common Presets
📖 Permission Bits Reference
- r (read) = 4
- w (write) = 2
- x (execute) = 1
- Total per class: r+w+x = 7
- 644 = rw-r--r-- (files)
- 755 = rwxr-xr-x (executables, dirs)
- 600 = rw------- (private)
- 700 = rwx------ (private dirs)
- 1777 = rwxrwxrwt (sticky dir, /tmp)
About Chmod Calculator
Unix and Linux file systems use a permission model with three classes (owner, group, others) and three basic permissions per class (read, write, execute). Permissions can be expressed in octal (755) or symbolic (rwxr-xr-x) notation. Additionally, three special bits — setuid, setgid, and sticky — modify behavior for executables and directories (a fourth leading digit in octal). Getting permissions right is critical for security and functionality: web servers need read access to files, CGI scripts need execute, /tmp needs the sticky bit, and getting it wrong leads to "403 Forbidden" or worse, security vulnerabilities. This calculator lets you toggle each permission visually and shows the equivalent octal, symbolic, and chmod command.
How It Works
- Toggle read/write/execute checkboxes for Owner, Group, and Others.
- Optionally enable special bits (setuid, setgid, sticky).
- See the octal (755) and symbolic (rwxr-xr-x) notations update live.
- Copy the generated chmod command (e.g., chmod 755 file.txt).
✨ Key Features
- ✓Toggle permissions visually (checkbox UI)
- ✓Octal notation (755)
- ✓Symbolic notation (rwxr-xr-x)
- ✓Special bits: setuid (4), setgid (2), sticky (1)
- ✓Generates exact chmod command
- ✓Preset buttons for common permissions (644, 755, 600, 700, 777)
- ✓Live updates as you toggle
- ✓Copy command with one click
- ✓Includes reference for common scenarios (web files, private keys, directories)
- ✓100% client-side — no data sent to any server
🎯 Common Use Cases
- →Configuring permissions for web files (644) and directories (755)
- →Setting up SSH keys (private 600, public 644)
- →Making scripts executable (755)
- →Setting up shared directories (/tmp is 1777 with sticky bit)
- →Debugging "Permission denied" errors
- →Learning Unix permissions by experimenting
- →Writing deployment scripts that use chmod
- →Understanding permissions of a file you received
💡 Advanced Tips & Pro Insights
- ▸Permission bits: read (r) = 4, write (w) = 2, execute (x) = 1. Each class (owner/group/other) sums these values. So 755 = owner rwx (4+2+1), group rx (4+1), other rx (4+1).
- ▸Common patterns: 644 for files (rw-r--r--), 755 for executable files and directories (rwxr-xr-x), 600 for private files (rw-------), 700 for private directories (rwx------), 777 for fully open (NOT recommended).
- ▸Directories require execute (x) to enter and read (r) to list contents. A directory with only r but no x cannot be cd'd into. A directory with only x but no r allows access to specific files if the path is known.
- ▸The sticky bit (1777) on a directory means only the file owner can delete or rename their own files — used for /tmp. Without it, any user with write access could delete anyone else's files.
- ▸setuid (4XXX) on an executable runs it with the file owner's privileges (e.g., passwd runs as root). setgid (2XXX) does the same for group.
- ▸The umask determines default permissions for newly created files. Common umask is 022 (files: 644, dirs: 755) or 002 (files: 664, dirs: 775).