Chmod Calculator, octal, symbolic & umask at a glance.
Toggle Read, Write, and Execute bits for Owner, Group, and Public, inspect 12-bit binary bitmasks and special flags (setuid, setgid, sticky), simulate umask defaults, and copy safe production chmod commands.
Presets
Permission Matrix & InputsIEEE 1003.1 (POSIX.1)
Owner (u)7
Group (g)5
Public (o)5
Special Mode Bits (Leading Digit: 0)
Special000
Owner111
Group101
Public101
POSIX Output & Security AuditSECURE
Octal Mode
0755
Short: 755
Symbolic (ls -l)
-rwxr-xr-x
u=rwx,g=rx,o=rx
Octal Command
chmod 755 deploy.sh
Symbolic Command
chmod u=rwx,g=rx,o=rx deploy.sh
Recursive Command
chmod -R 755 deploy.sh
Ownership Example
chown www-data:www-data deploy.sh
Owner: read, modify, execute
Group: read, execute
Public: read, execute
New Files (0666 − umask)
0644 · -rw-r--r--
New Directories (0777 − umask)
0755 · drwxr-xr-x
Ready. Toggle permissions, click a preset, or type an octal/symbolic mode.
THE DETAILS
POSIX.1 file mode bits, octal bitmasks, and Linux permission hardening.
1. Step-by-Step Workflow
Click a preset chip (0644, 0755, 0600, or 1777), toggle the 3×3 Owner / Group / Public matrix, or type directly into the Octal Mode or Symbolic Mode fields. Switch between File and Directory mode to get safe recursive find commands.
2. IEEE Std 1003.1 (POSIX.1) Bitmask Math
Under POSIX.1, file permissions are stored as a 12-bit integer divided into four 3-bit octal groups: Special bits (setuid=4, setgid=2, sticky=1), Owner (u), Group (g), and Other/Public (o).
3. World-Writable & Setuid Security Warnings
Enabling Public Write (o+w, such as 0777 or 0666) or combining setuid with world-writable permissions triggers an immediate security warning so dangerous modes are caught before deployment.
Standard source files, HTML/CSS assets, public certificates
0700
drwx------
Private home or ~/.ssh directories
0755
-rwxr-xr-x
Executable shell scripts, binaries, and public web directories
1777
drwxrwxrwt
Shared temporary directories (/tmp, /var/tmp) with sticky bit
Common File Permission Pitfalls
Files vs. Directories with chmod -R
Running chmod -R 755 on a web root makes every static file executable, while chmod -R 644 removes the execute bit from directories so users cannot cd into them. Use find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} + instead.
Uppercase S and T in Symbolic Output
In ls -l output, lowercase s or t means both the special bit and the underlying execute (x) bit are set; uppercase S or T means the special bit is set without the execute bit.
Directory Execute Bit Means Traverse
On a directory, the Read (r) bit allows listing filenames (ls), whereas the Execute (x) bit is required to traverse into the directory (cd) or access files inside it by path.
Default umask Interaction
When processes create new files, the shell umask (typically 0022) is subtracted from base permissions (0666 for files → 0644; 0777 for directories → 0755).
Frequently Asked Questions
How do you calculate octal chmod digits from r, w, and x permissions?
Each POSIX permission role (Owner, Group, Public) is a 3-bit octal digit: Read (r) adds 4, Write (w) adds 2, and Execute (x) adds 1. Summing the enabled bits gives 7 for rwx (4+2+1), 6 for rw- (4+2), 5 for r-x (4+1), 4 for r-- (4), and 0 for ---.
What is the difference between chmod 755 and chmod 644?
chmod 644 (-rw-r--r--) grants read and write access to the file owner and read-only access to everyone else, making it the standard mode for non-executable files and web assets. chmod 755 (-rwxr-xr-x) adds execute permission for all roles, required for executable scripts, binaries, and traversable directories.
Why is chmod 777 dangerous in production environments?
chmod 777 (-rwxrwxrwx) grants world-writable and executable permissions to every local user or compromised service account on the system, allowing attackers to modify scripts, inject malware, or overwrite configuration files.
What permissions are required for SSH keys and ~/.ssh/authorized_keys?
OpenSSH enforces strict permission checks: your ~/.ssh directory should be 0700 (drwx------), private keys (id_ed25519, id_rsa) must be 0600 (-rw-------), and public keys or authorized_keys should be 0644 (-rw-r--r--) or 0600.
What do the setuid (4000), setgid (2000), and sticky bit (1000) flags do?
The leading fourth octal digit sets special mode bits: setuid (4000, shown as s in the owner execute slot) runs an executable with the file owner’s privileges; setgid (2000) causes new files in a directory to inherit the directory’s group; and the sticky bit (1000, shown as t on /tmp) prevents users from deleting files owned by others.