nicetool.dev logo

Chmod Calculator

Tick the boxes or type an octal or symbolic mode; everything else updates instantly.

WhoReadWriteExecuteValue
Owner (u)7
Group (g)5
Others (o)5
$ chmod 755 file.txt
$ chmod u=rwx,g=rx,o=rx file.txt

ls -l: -rwxr-xr-x

Common permissions

How do Unix file permissions work?

On Linux, macOS and other Unix systems every file and directory has three sets of permissions: one for its owner (user), one for its group and one for everyone else (others). Each set can allow read (r), write (w) and execute (x), worth 4, 2 and 1. Adding them gives one octal digit per set, so rwxr-xr-x becomes 7, 5, 5, written as chmod 755. On directories, read lists the names, write creates or deletes entries and execute lets you enter the directory. A fourth leading digit holds the special bits: setuid (4), setgid (2) and sticky (1).

Features

  • • Checkbox grid for owner, group and others with live octal value
  • • Two-way editing: type 755 or rwxr-xr-x and the boxes follow
  • • setuid, setgid and sticky bit support with ls -l style display (s, S, t, T)
  • • Ready-to-copy commands in numeric and symbolic form (u=rwx,g=rx,o=rx)
  • • Presets for the most common modes with an explanation of each

Works offline

All calculations run in your browser. No file is touched: the tool only builds the command for you to run.

Pure calculator, 100% client-side.

How to use the Chmod Calculator

  1. 1

    Tick Read, Write and Execute for the owner, the group and others. The octal value and the rwx string update as you click.

  2. 2

    Or type a mode you already know, such as 640 or rwxr-x---, into the Octal or Symbolic field: the checkboxes follow.

  3. 3

    Add a special bit if you need one: setuid for programs that must run as their owner, setgid or sticky for shared directories.

  4. 4

    Enter the file name and copy the ready-made command, either chmod 755 file or the symbolic chmod u=rwx,g=rx,o=rx file.

Practical examples

Deploying a website

Typical web roots use 755 for directories and 644 for files, so the web server can read everything but only the deploy user can change it: find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} +.

Fixing SSH key errors

SSH refuses keys with loose permissions ("UNPROTECTED PRIVATE KEY FILE"). Use 600 for ~/.ssh/id_ed25519 and authorized_keys, and 700 for the ~/.ssh directory.

Making a script executable

After writing deploy.sh, chmod 755 deploy.sh (or chmod u+x deploy.sh for just yourself) lets you run it as ./deploy.sh.

Shared team folder

chmod 2775 /srv/project with the team as group owner: everyone in the group can write, and new files keep the project group thanks to setgid.

Frequently asked questions

What does chmod 755 mean?+

Owner: read, write, execute (7). Group: read, execute (5). Others: read, execute (5). It is the standard for scripts, binaries and directories that everyone may use but only the owner may change.

Is chmod 777 ever a good idea?+

Rarely. It lets every user and every compromised process modify the file. Fix ownership with chown or use group permissions instead. Shared directories should use 1777 (sticky) like /tmp.

Why does a directory need execute permission?+

For directories, x means "may enter and access files inside". Without it you cannot cd into the directory or open files in it, even if you can read the list of names.

What is the difference between 644 and 664?+

664 also lets the group write. Use 644 for files only you change, and 664 when a team sharing a group must edit the same files.