0755rwxr-xr-xAbout Chmod Calculator
Can never remember exactly what chmod 755 grants to whom, or which number maps to sticky and setuid? This tool makes Linux/Unix file permissions visual. Tick read/write/execute for owner, group and others to get the octal value (755) and the symbolic form (rwxr-xr-x); typing an octal back restores the checkboxes immediately. It also supports the three special bits — setuid, setgid, and sticky — with common presets for quick reference. For example, ticking owner rwx, group r-x, others r-x instantly gives 755 and rwxr-xr-x side by side. The usual mistake with file permissions is not forgetting the numbers, it is granting more than necessary on the assumption that it does not matter. Permissions decide who can read, write and execute, so over-granting means a key file readable by other users on the machine or a script modified by accident, and such problems are almost invisible in a test environment, surfacing only on a shared host or in production. Two notations exist: The symbolic form names roles and operations and reads clearly until it gets long and confusing; the numeric form sums a value per role, four for read, two for write and one for execute. Directory semantics differ from files, which is the most commonly overlooked point: read on a directory controls listing and execute controls traversal, so without the execute bit the contents are unreachable even with read permission. Practical notes: Apply least privilege, giving a service account read only when read is all it needs rather than adding write reflexively, and treat executables and configuration files separately, with configuration usually writable only by its owner. Directories generally need read and execute together to be usable. Recursive changes also touch everything beneath the target, so verify the path, especially with wildcards, before running them. Limits: On systems with access control lists, the mode bits are only a coarse layer and a list may separately grant or deny a specific user, which is why "the bits look right but access is denied" requires inspecting the list rather than editing modes again. Special bits such as set-user-ID, set-group-ID and the sticky bit have subtler semantics, and misusing them creates privilege escalation, so use them only when you know exactly why rather than copying a command. Ownership and group also matter, and changing modes without changing ownership often leaves the problem in place. Data and privacy: permission configuration reveals system structure and access policy, which is internal material. This tool computes in the browser without uploading. Before changing production permissions, record the current values so the change can be rolled back. The first misuse is granting too much: setting everything open for convenience lets any user on the machine rewrite or replace the file, and tampering with scripts or configuration is hard to notice, a problem that rarely shows on a developer machine. The second is changing modes without changing ownership — a denial often stems from a mismatched owner rather than insufficient bits, so check identity before modes.
How It Works Internally
Each role owns three permission bits: read is four, write two and execute one, and the three role values concatenate into a three-digit octal number. Directories differ in meaning from files — read controls listing, execute controls traversal — so a directory normally needs both to be usable, and an access control list may grant or deny separately with higher precedence than the bits.
755Owner rwx (4+2+1=7) | Group r-x (4+0+1=5) | Others r-x (5): traversable, listable, executable, not writableMeasured on This Page
| Regular modes | 755 to rwxr-xr-x, 644 to rw-r--r--, 000 to ---------; all 15 match stat.filemode |
|---|---|
| setuid/setgid | 4755 gives rwsr-xr-x (s in the owner execute slot); capital S when the owner lacks execute |
| Sticky bit | 1777 gives rwxrwxrwt; capital T when others lack execute — matching ls output exactly |
| Short input | Entering 75 pads as chmod does, to 075 (owner 0, group 7, others 5) |
| All special bits | 7777 gives rwsrwsrwt, faithfully reflecting the four-digit octal |
The case details are the easiest to get wrong: s for setuid/setgid and t for the sticky bit are lowercase only when the corresponding execute bit is set, otherwise uppercase S/T signals a special bit without execute. All 15 cases match Python's ls-equivalent algorithm character by character. One reminder: a short octal argument to chmod pads on the left rather than reading left to right — chmod 75 equals 075, not 750.
How to Use
- Open "Chmod Calculator"
- Enter a three- or four-digit octal mode
- Or tick the read, write, and execute boxes
- Toggle setuid, setgid, or sticky when needed
- Copy the chmod command for your terminal
Use Cases
- Deploy scripts — Confirm which number your chmod command needs, avoiding stray write access on a directory.
- Debug permissions — Reverse an rwx string from a failing file into octal to see who lacks the execute bit.
- SSH keys — Verify the 600 a private key needs so ssh does not refuse to load it for being too open.
- Shared folders — Use the sticky bit (1777) for a public temp directory so users cannot delete each other files.
- Read symbolics — Map the rwx string from ls -l output to its equivalent numeric permission.
- Dockerfile permissions — Check the correct octal values for COPY and RUN commands in Dockerfiles to ensure containers run with least privilege.
- Git hook scripts — Verify that pre-commit or pre-push hook scripts have the correct executable permissions (755) without excessive access.
FAQ
Is 755 different from 0755?
Numerically equivalent. The leading 0 means the special bits (setuid/setgid/sticky) are 0. The tool shows both the three-digit form and the four-digit form with special bits for different needs.
What do s and t mean in the rwx string?
s marks a setuid or setgid bit with execute present; uppercase S means no execute. t/T marks the sticky bit. They appear in the execute position.
Is setuid useful on directories?
Generally no. setuid mainly affects executables, running a program as its owner, and is usually ignored on directories. setgid on a directory is meaningful: new files inherit the group.
How do I pick common permissions?
Directories often use 755, regular files 644, executable scripts 755, and secrets like keys 600. The tool ships these presets for one-tap use.
Can it change file permissions on my server?
No. It only computes permissions visually, outputting values to copy into a chmod command; it never connects to or alters any real filesystem.
Permissions look correct but access is still denied. Why?
Mode bits are only the coarse layer. Without the execute bit a directory cannot be entered or traversed, so its contents stay unreadable even with read permission, and an access control list may separately deny a specific user with higher precedence than the bits. Diagnose in order: confirm every directory along the path has the execute bit, check that the owner is who you expect, and only then inspect the access control list, which avoids editing modes repeatedly.
Is setting everything to 777 the easy option?
No. Full permissions let any other user on the machine rewrite or even replace the file, and tampering with a script or configuration is hard to notice, a class of problem that rarely shows on a developer machine and surfaces only on a shared host or in production. Apply least privilege instead, granting read alone when read is all a service needs, and share write access through group ownership rather than opening it to everyone.
Are 755 and u=rwx,g=rx,o=rx equivalent?
Exactly — they are two notations for the same thing: numeric mode sums r=4, w=2, x=1 per group while symbolic mode spells out the letters. The tool converts both ways. Remember setuid/setgid/sticky live in a fourth octal digit (4755).