Chmod Calculator

Toggle permission checkboxes and get octal, symbolic and a ready chmod command

Permission editor
Owner (u)
Group (g)
Others (o)

In each block the checkboxes, the octal digit and the symbol mirror one another. Edit any of the three and the rest update at once. Typing s, S, t or T in the last slot toggles a special bit directly.

Special bits

setuid sits in the owner execute slot, setgid in the group slot and sticky in the others slot. Ticking one turns the octal value into four digits, such as 4755.

Common presets

Click to apply. The preset matching the current mode stays highlighted.

The target name inside the commands. Replace it with a real path such as /var/www/html.

Octal (special bits included)755
Binary (one triple per class)111 101 101
Symbolic string (ls style)
rwxr-xr-x
Numeric command
chmod 755 file
Symbolic command
chmod u=rwx,g=rx,o=rx file

A leading zero in the numeric form is optional, so 0755 equals 755. With special bits present, write all four digits, for example 4755.

How to use

  1. Tick read, write and execute in the Owner, Group and Others blocks. The octal digits, the symbolic string and the results refresh at once.
  2. 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.
  3. Tick a special bit to add setuid, setgid or sticky. The octal value then shows four digits, such as 4755.
  4. Click a preset to apply 644, 755, 4755 and other common modes, then fine-tune single bits.
  5. 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?
For files, r reads the content, w modifies it and x runs the file as a program. For directories, r lists the entry names, w creates, renames or removes entries inside, and x enters the directory and reaches the entries.
Why does deleting a file depend on the directory's w?
A file name is just a record inside its directory. Removing or renaming it changes the directory, which needs w and x on the directory, not on the file. To protect a file from deletion, removing its own w is not enough. Tighten the directory as well.
What happens when a directory lacks x?
The usual symptom is that names are listed but nothing opens, and the shell prints Permission denied. A directory with r but no x lets you browse names only. You cannot enter it or read any entry. Most directories need at least x, with r added when listing is wanted.

FAQ

When should I use 755 or 644?
755 gives the owner full access and everyone else read and execute. It suits directories, executable scripts and program folders. 644 gives the owner read and write and everyone else read only. It suits ordinary web pages and config files. The classic pairing is directories 755 with files 644.
What is risky about 777?
777 lets every user write and execute. Web pages can be tampered with and scripts can get malicious code injected. When several people need to write, prefer group permissions with a setgid directory instead of opening everything to everyone.
What are setuid, setgid and sticky used for?
setuid runs an executable as its owner, and passwd is the classic case. setgid on a directory makes new files inherit the directory's group, which fits team share folders. Sticky appears on /tmp, where users may delete only their own files. Lowercase s and t mean the special bit plus execute, while uppercase S and T mean the special bit without execute.
Do my inputs leave the browser?
No. Checkbox state, octal conversion and command generation all run locally. The page sends no network requests, and nothing you enter leaves the device.

How to use

  1. Tick the bits

    Tick read, write and execute under Owner, Group and Others. The octal digits, the symbolic string and both commands refresh together.

  2. 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.

  3. 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.

  4. 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

  1. 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.

  2. 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.

  3. 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.

Related Tools