Linux Chmod Permissions Calculator
Compute exact Unix octal bitmasks and symbolic permission strings for Owner, Group, and Others with real-time bitwise evaluation.
Owner rwx, Group r-x, Public r-xReady locally via WebAssembly & JavaScript
chmod 755 filename (-rwxr-xr-x)100% Client-Side • Zero Server Upload
Unix and Linux file systems enforce discretionary access control through compact permission bits stored inside every file inode. When provisioning servers, writing Dockerfiles, or hardening CI/CD runners, misreading a single bit can either break application startup with EACCES errors or silently expose sensitive credentials to unprivileged local accounts. This calculator translates human-readable permission toggles into exact octal numbers and POSIX symbolic strings in real time.
Every calculation executes locally inside your browser using native JavaScript bitwise operations. No directory paths, server configurations, or infrastructure metadata ever leave your machine, making the tool safe for auditing hardened production topologies and air-gapped environments.
POSIX Bitmask Architecture and Octal Encoding
POSIX.1-2017 defines standard file mode bits (st_mode) using three independent access classes: Owner (u, the file's UID), Group (g, users matching the file's GID), and Others (o, all remaining local accounts). Each class occupies 3 bits inside the lower 9 bits of the mode integer, forming a 9-bit permission mask that maps cleanly to base-8 (octal) representation because one octal digit encodes exactly 3 binary bits.
Inside each 3-bit triad, individual rights correspond to powers of two:
- Read (
r) =4(0b100): Permits reading file contents or listing directory entry names withreaddir(). - Write (
w) =2(0b010): Permits modifying file data or creating, renaming, and unlinking entries inside a directory. - Execute (
x) =1(0b001): Permits invoking a regular file viaexecve(), or traversing a directory (chdir/ path lookup) to reach its child inodes.
Summing the active bits in each triad yields an octal digit from 0 (---) to 7 (rwx). For example, rwx equals 4 + 2 + 1 = 7, r-x equals 4 + 0 + 1 = 5, and rw- equals 4 + 2 + 0 = 6. Concatenating the Owner, Group, and Others digits produces familiar modes such as 0755 or 0644. When an upper 4th octal digit is omitted, chmod treats the special bits—setuid (4000), setgid (2000), and sticky (1000)—according to existing inode defaults or clears them on regular files depending on the utility flags.
Practical Developer Walkthrough: Hardening SSH and Web Roots
Consider deploying an API service on Ubuntu where a CI runner uploads release artifacts, TLS keys, and static assets. Applying the wrong permission mask across directories and private files causes frequent deployment failures.
OpenSSH checks st_mode via stat() and aborts authentication if any Group or Others bits are non-zero:
# Inspect current permissions before hardening
ls -ld ~/.ssh ~/.ssh/id_ed25519 ~/.ssh/authorized_keys
# -rw-r--r-- 1 deploy deploy 411 Nov 27 09:14 /home/deploy/.ssh/id_ed25519
# Apply strict Owner-only masks
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/authorized_keys
Here, ~/.ssh uses 700 (drwx------) so the owner can traverse (1), edit known_hosts (2), and list entries (4), while all other users get 0. Because id_ed25519 is data rather than an executable program, 600 (-rw-------) omits the execute bit to enforce least privilege.
Next, configure a web root served by Nginx under www-data while files remain owned by deploy:
# Directories require 755 so Nginx can traverse paths
find /var/www/app/public -type d -exec chmod 755 {} +
# Static HTML, JS, CSS, and JSON files only need 644
find /var/www/app/public -type f -exec chmod 644 {} +
# Entrypoint scripts owned and executed by the deploy group get 750
chmod 750 /var/www/app/bin/start-worker.sh
Separating find -type d (755) from find -type f (644) lets www-data traverse subdirectories and read assets without marking static files executable or granting write access to unprivileged accounts.
Common Octal Modes Reference Table
| Octal | Symbolic | Binary Triad | Typical Target | Operational Behavior |
|---|---|---|---|---|
400 | r-------- | 100 000 000 | Archived PEM keys | Owner read-only; blocks edits and group/world access. |
600 | rw------- | 110 000 000 | ~/.ssh/id_ed25519, .env | Required by OpenSSH; blocks all other UIDs. |
640 | rw-r----- | 110 100 000 | Service configs, logs | Owner edits; service group reads; others denied. |
644 | rw-r--r-- | 110 100 100 | Static web assets | Standard non-executable default under umask 022. |
700 | rwx------ | 111 000 000 | ~/.ssh, private scripts | Full owner access; blocks others from listing contents. |
750 | rwxr-x--- | 111 101 000 | Internal binaries, dirs | Owner full control; assigned group can traverse/run. |
755 | rwxr-xr-x | 111 101 101 | Public dirs, CLI tools | Standard directory/executable mode; world-readable. |
777 | rwxrwxrwx | 111 111 111 | Never in production | World-writable and executable; severe tampering risk. |
Production Pitfalls, Security Risks, and Edge Cases
The most dangerous anti-pattern in Linux administration is running chmod -R 777 to silence a permission error. Granting rwx to Others allows any compromised daemon or unprivileged local user to overwrite binaries, tamper with configs, or plant web shells in upload folders. Instead, assign proper ownership (chown) or shared group membership (750 or 775).
Recursive chmod -R commands also cause subtle outages. Running chmod -R 644 /var/www/site strips the execute (x) bit from directories, locking non-root processes out of subdirectories even with read (r) enabled. Conversely, chmod -R 755 marks every certificate and stylesheet as executable. Use chmod -R u+rwX,go+rX,go-w (uppercase X), which applies execute bits only to directories and files already marked executable.
Finally, remember umask: a default 0022 mask strips group and world write bits (2), turning kernel creation defaults (0666 files, 0777 dirs) into 0644 and 0755. When writing secrets programmatically, pass 0600 directly to open() to eliminate race windows before chmod.
How to Use Linux Chmod Permissions Calculator
Toggle the Read (4), Write (2), and Execute (1) checkboxes for Owner, Group, and Others, or enter a 3-digit octal value directly.
Inspect the generated symbolic mode string (for example, rwxr-xr-x) and verify each permission triad.
Select a standard baseline preset such as 600 for private keys or 755 for executable directories if needed.
Copy the generated chmod command and apply it on your Unix, Linux, or macOS host.
Real Examples
Executable Script (755)
Owner full access, Group & Public read/execute.
Owner rwx, Group r-x, Public r-xchmod 755 filename (-rwxr-xr-x)Frequently Asked Questions
How does the octal bitmask calculation work in chmod?
Why does OpenSSH reject private keys unless permissions are 600 or 400?
What is the difference between chmod 644 and chmod 755 for web deployments?
Why is chmod 777 dangerous in production environments?
What does the execute bit mean on a Linux directory versus a regular file?
Key Features
- Interactive 9-bit matrix toggling Read, Write, and Execute for Owner, Group, and Others
- Instant bidirectional synchronization between octal digits, symbolic notation, and checkboxes
- One-click POSIX security presets including 600, 644, 700, and 755
- Ready-to-run chmod CLI command preview with recursive flag guidance
- 100% client-side bitwise computation with zero telemetry or server requests
Common Use Cases
- Locking down ~/.ssh/id_ed25519 private keys and authorized_keys files before remote login
- Auditing Nginx, Apache, or Node.js deployment artifacts for least-privilege modes
- Verifying Linux container Dockerfile COPY --chmod permissions prior to image builds
- Translating verbose ls -l symbolic strings like -rwxr-x--- into compact octal codes
- Teaching Unix discretionary access control and bitwise permission masks to new engineers
Related Tools
Explore More Tools in This Category
View All Developer & Utility ToolsBase64 Encoder — Text, File & Data URI Encoding Tool
Encode and decode UTF-8 text, JSON payloads, images, and binary files using RFC 4648 standard or URL-safe Base64url with instant Data URI output and live byte-expansion metrics, 100% client-side.
Base64 Decode Tool
Decode standard RFC 4648 and URL-safe Base64 strings into readable UTF-8 text, formatted JSON, or downloadable images with automatic magic-byte sniffing directly inside your browser.
URL Encoder & Decoder Tool
Percent-encode full URIs, individual query parameters, and multi-byte UTF-8 text using RFC 3986 and JavaScript encodeURI/encodeURIComponent rules with an interactive query string builder.
URL Decoder Tool
Unescape percent-encoded URLs and query strings back into readable UTF-8 text, inspect and edit key-value parameters visually, and diagnose malformed or double-encoded sequences locally in your browser.
JWT Decoder Tool
Inspect JSON Web Tokens locally in real time. Decode Base64url headers and payload claims, evaluate Unix exp/iat/nbf timelines, and flag risky signing algorithms without sending tokens over the network.
Hash Generator Tool
Compute MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-256, and SHA3-512 cryptographic digests simultaneously for text or local files directly inside your browser.
MD5 Generator Tool
Compute 128-bit MD5 checksums for UTF-8 strings and large local files with 2 MB chunked browser streaming, live hash verification, and zero server uploads.
SHA256 Generator Tool
Generate FIPS 180-4 SHA-256 digests for text and local files entirely in your browser using hardware-accelerated Web Crypto APIs, hybrid chunked streaming, and instant hash comparison.