Chmod Calculator

Convert Unix file permissions between octal like 755, symbolic rwxr-xr-x and checkboxes, apply u+x style changes, and decode setuid, setgid, sticky and umask.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Chmod Calculator?

Tick read, write and execute for the owner, the group and everyone else, or type a mode in any notation, and this chmod calculator keeps every form in sync: the octal number such as 755, the symbolic string rwxr-xr-x, the ls -l form with its file-type letter, and a plain-English description of who can do what. Typing a full ls -l string such as drwxrwxrwt or -rwsr-xr-x works too, so you can paste straight from a terminal. The setuid, setgid and sticky bits have their own checkboxes and show up as s, S, t or T exactly as ls prints them.

A second panel applies symbolic chmod expressions such as u+x, go-w, a=rX or o=g to the current mode, with the same rules chmod uses, including the capital X that only adds execute to directories and already-executable files, and the umask that protects bits when you leave out u, g, o or a. You also get the default permissions that a given umask produces for new files and directories, ready-to-copy chmod commands in octal and symbolic form, warnings for risky modes such as world-writable files or setuid scripts, and a table of the modes people use every day.

  • Checkbox grid, octal, symbolic and ls -l input, all kept in sync
  • Setuid, setgid and sticky bits with s, S, t and T
  • Symbolic chmod expressions, including X, o=g and umask behaviour
  • umask defaults for new files and directories
  • Warnings for world-writable, setuid and other risky modes
  • Copy-ready commands and a table of common modes
Read the guide: Linux File Permissions and chmod: 755, 644 and Beyond

How to use the Chmod Calculator

  1. Choose whether the target is a file or a directory; it changes the ls -l letter, the X rule and some warnings.
  2. Tick permissions in the grid, or type an octal mode or a symbolic or ls -l string.
  3. Read the octal, symbolic and ls -l results, the plain-English description and any warnings.
  4. To change an existing mode, type a symbolic expression such as go-w,u+x and set the umask if it differs from 022, then click "Use this".
  5. Enter the file name and copy the chmod command.

Worked examples

A deploy script

Input

Start 644, apply u+x

Output

744 (rwxr--r--)

Only the owner can run it. Use a+x or 755 if other users must run it too.

An SSH private key

Input

600

Output

rw-------, owner read and write only

OpenSSH refuses to use a private key that other users can read, so 600 (or 400) is required.

Shared team folder

Input

2775 on a directory

Output

drwxrwsr-x, setgid

Group members can create files, and new files get the folder's group instead of each user's primary group.

Recursive fix without making files executable

Input

Start 640, apply a=rX

Output

Files 444, directories 555

X adds execute only where it makes sense, which is why chmod -R a+rX is the safe way to open up a tree.

Background and insight

Every file on a Unix-like system has three permission classes (user, group and others) and three permissions in each (read, write and execute), stored as nine bits. Octal notation packs each class into one digit by adding read 4, write 2 and execute 1, so rwx is 7, r-x is 5 and r-- is 4, and rwxr-xr-x is 755. A fourth, leading digit holds the special bits: setuid 4, setgid 2 and sticky 1. chmod 4755 makes a program run with its owner's privileges, which is how passwd can update /etc/shadow.

Permissions mean different things on directories. Read lets you list the names, write lets you create, rename and delete entries, and execute (search) lets you enter the directory and reach files inside by name. That is why directories are usually 755 and files 644, and why a directory with read but no execute shows names you cannot open. setgid on a directory makes new files inherit the directory's group, which keeps shared project folders consistent, and the sticky bit on a world-writable directory such as /tmp (mode 1777) stops users deleting each other's files.

POSIX defines the symbolic syntax as [ugoa][+-=][rwxXst], with several clauses separated by commas. When no class is given, the change applies to all three but bits set in the process umask are left alone, so chmod +w with umask 022 only adds write for the owner. The umask also sets the defaults: files start from 666 and directories from 777, and the umask bits are removed, so umask 022 gives 644 and 755 and umask 077 gives 600 and 700. GNU chmod additionally keeps the setuid and setgid bits on directories unless you name them explicitly.

Common use cases

  • Web hosting and deployment

    Set 644 for files and 755 for directories after an upload, and find the commands to fix a whole tree.

  • SSH and secrets

    Check that keys, .env files and credential stores are 600 and their folders 700.

  • Reading ls -l output

    Decode s, S, t and T characters and understand why a command says permission denied.

  • Learning and exams

    Practise octal arithmetic, symbolic chmod and umask questions for Linux certifications.

Tips and limitations

  • Never fix a permission error with chmod 777. Find which user needs access and grant only that, often with chown or a group.
  • Use find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} + to set directories and files separately.
  • Linux ignores setuid on shell scripts for security; it only works on compiled binaries.
  • The sticky bit on regular files does nothing on Linux; it matters on directories.
  • chmod cannot change permissions on files owned by someone else unless you are root.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute (7 = 4+2+1), and the group and others can read and execute (5 = 4+1). In symbolic form it is rwxr-xr-x. It is the usual mode for directories and for programs everyone may run.

What is the difference between chmod 644 and 755?

644 (rw-r--r--) lets the owner edit and everyone read, with no execute bit, which suits ordinary files. 755 adds execute for everyone, which directories need so people can enter them and scripts need so they can run.

What permissions should an SSH private key have?

600 (owner read and write) or 400 (owner read only). The ~/.ssh directory should be 700. OpenSSH refuses keys that group or others can read and reports "UNPROTECTED PRIVATE KEY FILE".

What does a capital S or T mean in ls -l output?

The special bit is set but the matching execute bit is not. S in the owner or group position means setuid or setgid without execute, which has no useful effect on a file. T in the others position means the sticky bit without execute for others.

Is chmod +x the same as chmod a+x?

Nearly. a+x adds execute for everyone regardless of umask. +x with no class also applies to everyone, but POSIX says bits set in the umask are left alone. With the usual umask 022 the two give the same result for execute; for +w they differ.

What does umask 022 do?

It removes write permission for group and others from new files and directories. Files are created as 666 minus 022, which is 644, and directories as 777 minus 022, which is 755.

Is there an in-depth guide to the Chmod Calculator?

Yes. “Linux File Permissions and chmod: 755, 644 and Beyond” covers the background, how it works, common pitfalls and worked examples. Read the full guide.

People also search for

  • what does chmod 755 mean
  • chmod 644 vs 755 for web files
  • what permissions for ssh private key
  • chmod u+x vs chmod +x difference
  • what does capital s mean in ls -l permissions
  • chmod 777 why is it bad
  • umask 022 default file permissions
  • chmod recursive read for directories only