Chmod Calculator

Tick read, write and execute for the owner, group and others, or type a three-digit octal mode. The boxes, the symbolic permissions and the chmod command stay in sync. It runs in your browser, nothing is sent or saved, and it never changes a file.

Owner
Group
Others
rw-r--r--

Your chmod command

chmod 644 <filename>

Replace <filename> with your own path before you run it. This page only builds the text; nothing runs here.

Common examples: 644 and 755

  • chmod 644 (rw-r--r--)

    The owner can read and write. Group and others can only read. This is the usual mode for ordinary files such as documents and web pages.

  • chmod 755 (rwxr-xr-x)

    The owner can read, write and execute. Group and others can read and execute. This is the usual mode for directories, scripts and programs that other users need to reach.

How the octal digits work

Each digit is one class of user: owner first, then group, then others. Add up what that class may do: read is 4, write is 2 and execute is 1. So 6 is read and write (4 + 2), 5 is read and execute (4 + 1), and 0 is nothing.

Only one class applies to you. If you own the file, the owner digit decides, even when the others digits are more generous. Otherwise the group digit applies if you are in the group, and the last digit applies to everyone else.

Execute on a file versus a directory

On a file, execute means the file can be run as a program. Scripts also need read, because the interpreter has to read them.

On a directory, execute means you can enter it and reach what is inside by name. Read only lets you list the names, and write adds or removes entries when execute is also set. That is why a directory is usually 755 while the files inside it are 644: the same digit does a different job on each.

777 and recursive changes are not repairs

Mode 777 lets any user on the system change the target, and on a directory it lets them delete or replace what is inside. It can hide a permission error without explaining it, and some tools, such as SSH with private keys, refuse to work with permissions that open.

Recursive changes apply one mode to files and directories alike, even though they need different bits. A recursive 755 makes every file executable, and a recursive 644 removes execute from directories so they can no longer be entered. This calculator only builds commands for a single path. Check the owner and the parent directories with ls -l first, then change only what needs changing.

Special bits are not supported

This calculator covers the nine ordinary permission bits. It does not handle setuid, setgid or the sticky bit, the optional fourth leading digit in modes such as 4755. Entering one gets an error, so nothing is silently cut down to three digits.

Frequently asked questions

What does chmod 755 mean?

The owner gets read, write and execute (7), and the group and others get read and execute (5). In symbolic form it is rwxr-xr-x. It suits directories and programs that other users need to reach but should not change.

What does chmod 644 mean?

The owner gets read and write (6), and the group and others get read only (4). In symbolic form it is rw-r--r--. It suits ordinary files that everyone may read. Use a tighter mode such as 600 for private files like keys.

Why does a directory need execute permission?

Execute on a directory lets you enter it and reach the files inside by name. Read only lets you list the names. Without execute, cd fails and the files inside cannot be opened, even when their own permissions allow it.

Should I use chmod 777 to fix a permission denied error?

No. Mode 777 lets every user on the system change the target, and a denied request often has another cause, such as the wrong owner or a parent directory without execute. Find the cause with ls -l and grant only what is missing.

Does this calculator support setuid, setgid or the sticky bit?

No. It covers the nine ordinary permission bits only. A four-digit mode such as 4755 gets an error rather than being cut down to three digits.

Related