Chmod Calculator
Toggle permission checkboxes and get octal, symbolic and a ready chmod command
How to use
- Tick read, write and execute in the Owner, Group and Others blocks. The octal digits, the symbolic string and the results refresh at once.
- Type into one block's octal digit or three-letter symbol instead. Checkboxes and the other field follow, and the last slot accepts s, S, t or T.
- Tick a special bit to add setuid, setgid or sticky. The octal value then shows four digits, such as 4755.
- Click a preset to apply 644, 755, 4755 and other common modes, then fine-tune single bits.
- Replace the target name with a real path and copy either command into your terminal.
Directories versus files
Does the same rwx mean different things on files and directories?
Why does deleting a file depend on the directory's w?
What happens when a directory lacks x?
FAQ
When should I use 755 or 644?
What is risky about 777?
What are setuid, setgid and sticky used for?
Do my inputs leave the browser?
How to use
- Tick the bits
Tick read, write and execute under Owner, Group and Others. The octal digits, the symbolic string and both commands refresh together.
- Type octal or symbolic
Each block has an octal digit and a three-letter symbol input. Edit any one and the checkboxes plus the other field follow. The last slot accepts s, S, t or T.
- Presets and special bits
Click a preset such as 644, 755 or 4755 to fill a common mode. Tick setuid, setgid or sticky afterwards to move to the four-digit form.
- Copy a command
Put a real path in the target box, then copy either the numeric command or the symbolic one and paste it into your terminal.
About this tool
Linux splits file permissions into three classes: owner, group and others. Each class carries three switches for read, write and execute, written r, w and x. Every switch has a value: read counts 4, write counts 2 and execute counts 1. The sum of a class lands between 0 and 7, and three digits in a row form the mode, for example 755. The symbolic form spreads the same bits into nine letters such as rwxr-xr-x, where a dash marks a switch that is off. Both notations describe the same state and convert into each other. Numeric modes suit one-shot assignment in a command, while symbolic modes describe a targeted change such as adding execute for the group only.
This tool lays the nine switches out as checkboxes and pairs each class with an octal digit and a three-letter symbol field. Editing any of the three inputs updates the other two, so the views can never disagree. The special bits setuid, setgid and sticky add one more octal digit. Four-digit modes such as 4755 appear, and the string shows the letters s, S, t or T. Common modes ship as one-click presets, and the preset matching the current state stays highlighted. Both commands appear ready to copy, with a target name you can replace. Every calculation runs locally in the browser and nothing is uploaded.
How it works
Octal and symbolic notations encode the same switches. The nine basic bits collapse into three digits from 0 to 7, and the special bits add one more digit on top. setuid counts 4, setgid counts 2 and sticky counts 1. That extra digit produces four-digit modes such as 1777 and 4755. In the symbolic string the extra bit lives in the execute slot of its own class. A lowercase s means the special bit and execute are both on. An uppercase S means only the special bit, and sticky follows the same rule with t and T. The converter keeps every view in step, so editing the string recomputes the digits and editing the digits re-ticks the boxes.
Numeric and symbolic commands behave differently. A numeric mode is an absolute assignment: chmod 755 file resets all nine bits and clears any special bits. A symbolic mode assigns per class. A form such as u=rwxs hands the special bit to that class in one step, equivalent to u=rwx followed by u+s. The two commands this tool shows always describe the same state. Keep umask in mind for new files: it shapes the default mode at creation time and never touches existing files. When recursing through a directory tree, remember that execute means enter for directories but run for files, so one blanket value rarely fits both.
When to use it
- Deploy a website
After uploading an application, set directories to 755 and files to 644 so the web server can read everything while visitors cannot rewrite it. Apply the two presets, compare the symbolic strings with the plan, and avoid leaving config files or data files writable to the world.
- Make a script runnable
A deploy script that fails with Permission denied usually lacks the execute bit. Tick execute in the right block to reach 755 or 700, copy the generated command, and the script runs again. That avoids digging through manuals for digits and repeated trial runs on the server.
- Harden a shared folder
A team folder that should stamp new files with one group wants setgid, for example 2775, plus group write and no access for others. Sticky suits public scratch areas such as /tmp, where everyone may write but each user can delete only their own files.
Tips & tricks
- Remember 4, 2, 1 for read, write and execute. The sum of a class is its octal digit: 7 is full access, 5 is read plus execute, 4 is read only.
- Think separately for files and directories. Web deployments usually want directories 755 and files 644, while private keys deserve 600.
- An uppercase S or T means the special bit is set but execute is missing. That is usually a half-finished edit rather than an intended state.
Things to watch
- Never settle for 777
Opening write access to everyone lets attackers tamper with pages and replace scheduled jobs. When permissions look broken, tighten to 755 first and then open single bits as needed. That habit costs far less than cleaning up tampered pages afterwards.
- x differs on files and directories
On a file, execute means run the program. On a directory, it means enter and reach entries. Applying 755 recursively across a site gives every file the execute bit, which is mostly harmless but hides the files that truly need it.
- setuid does nothing on scripts
The Linux kernel ignores the setuid bit on interpreted scripts and honors it only on binaries. To raise a script's privileges, use sudo or wrap it in a small binary. The s in the string looks real but changes nothing at run time.