Omni Calculator logo

Chmod Calculator

Created by Hanna Pamuła, PhD
Reviewed by Bogna Szyk and Jack Bowater
Last updated: May 08, 2024


With this chmod calculator, you will quickly find out how to set the permissions of your files. On top of the calculations, we'll briefly explain what chmod is, give you a quick chmod example, as well as a Linux permission chart. Also, if you want to check what those mysterious numbers next to the chmod command mean, you can do it with this permissions calculator.

Are you ready?

What is chmod command?

The name chmod is an abbreviation of change mode. It's a command used in Unix and Unix-type operating systems to change the permissions of files or directories.

There are different permissions for three classes: the user, the group, and the others. But who is who?

Class

Description

User/owner

The user/owner of a file or directory

Group

Users who are members of the file's group

Others

Users who are not the owner of the file or members of the group

Permissions must be set for each class and can be expressed in a couple of ways - in a symbolic format (rwx), or in a numeral system (binary or octal format):

Permission

Symbolic

Numeral

read-write-execute

Binary

Octal

read, write and execute

rwx

111

7

read and write

rw-

110

6

read and execute

r-x

101

5

read only

r--

100

4

write and execute

-wx

011

3

write only

-w-

010

2

execute only

--x

001

1

none

---

000

0

All you need to do is to choose permissions for each of the three classes.

🙋 Visit the binary to octal converter to learn how to switch between these two numeral systems!

This table above may also be called the Unix or Linux permission chart. Also, an additional letter may be shown in the leftmost position, denoting the file type, e.g. drwxrwxrwx for a directory, -rwxrwxrwx for a regular file.

It becomes more intuitive if you consider how the binary system is used in logic gates. 1 means true/on, whereas 0 corresponds to false/off. If a file is read-only, then it's r--. Since only r is "on, it's expressed as 100 numerically.
You can read more about these concepts in the logic gate calculator and the binary converter.

Chmod example

So, how to use the chmod command? Check the following example:

Let's assume that we want to change the permissions in such a way that the owner can do everything to the file (read, write, execute), but we want everybody else only to be able to read and execute that file.

  1. Start from the owner's access – we want them to be able to read, write, and execute, so we can write this symbolically as rwx. This is our first triad. As we let the owner do all three actions, its binary code is 111. In the octal numeral system, it is the same as 7 (1112 = 1 × 22 + 1 × 21 + 1 × 20 = 78.
  2. Proceed to the second class – group permissions. For this set, we only want them to read and execute the file but not to change it (write). It can be expressed as r–x, with a dash in the place of the writing permission. In binary representation, it's 101 – in octal – 5 (1012 = 1 × 22 + 0 × 21 + 1 × 20 = 58).
  3. Finally, we come to the third class – the others. We'd like to give them the same permissions as for the group class, so just repeat the characters from the previous step.

Take the digit that represents your permissions for each class in the octal system, and you've got your result – chmod 755.

To sum up all we've learned from this chmod example, look at this table:

User

Group

Others

Chmod permissions

read, write and execute

read and execute

read and execute

rwx

r-x

r-x

= rwxr-xr-x

111

101

101

= 111101101

7

5

5

= chmod 755

To set the permissions required in the example, just use the command chmod 755 file_name. You can do it manually, but, of course, our permissions calculator is here to help you do rapid conversions.

Chmod permissions: special modes

It may happen that you get four digits instead of three. What does the extra digit mean? And which is the additional one?

The three rightmost octal digits are always the permissions for the classes we mentioned before – owner, group, and others, respectively. If four digits are entered, then the leading number – the leftmost digit – addresses the three special modes:

  • The setuid bit – Short for a set user ID (in symbolic notation, 'x' becomes 's' and the '-' becomes 'S' for the user triad);
  • The setgid bit – Short for set group ID (in symbolic notation, 'x' becomes 's' and the '-' becomes 'S' for the group triad); and
  • The sticky bit – Restricted deletion bit (in symbolic notation, 'x' becomes 't' and the '-' becomes 'T' for the others triad).

The first two access flags are used when different privileges than usual are granted (e.g., in the situation of changing passwords). The sticky bit is more commonly used on directories – it prevents ordinary users from moving or deleting the other user's files (e.g., from /tmp directory).

1st digit (out of 4)

Setuid?

Setgid?

Sticky bit?

0

0

0

0

1

0

0

1

2

0

1

0

3

0

1

1

4

1

0

0

5

1

0

1

6

1

1

0

7

1

1

1

You can find these special options in our permissions calculator's Advanced mode.

How to use this chmod calculator?

This chmod calculator has two functionalities – you can use it to:

  • find the command to set the permissions for your files and directories,
  • understand what the octal modes mean – e.g., chmod 777, chmod 400, chmod 4664.

The first functionality was explained above (in the chmod example paragraph), so let's focus on the other mode.

Let's assume that you are wondering what chmod 777 means:

  1. Choose the appropriate calculator mode. We need to pick the option: decode octal number next to chmod.
  2. Input the value. Enter 777 into the field.
  3. Thanks to this permissions calculator, you will find out many useful things; yay!
  • Each class (user/owner, group, other) can read, write and execute the file/directory;
  • chmod 777 can also be expressed in the binary format as 111111111; and
  • chmod 777 can also be shown in the symbolic form as rwxrwxrwx.

Keep in mind that setting the permissions to chmod 777 may not be the best idea – the files will be readable, writable, and executable by everybody. Are you sure this is what you want?

Hanna Pamuła, PhD
I want to
find chmod command
Who can read?
User / Owner
✔️
Group
✔️
Other
✔️
Who can write?
User / Owner
✔️
Group
Other
Who can execute?
User / Owner
✔️
Group
✔️
Other
✔️
CHMOD Results & Interpretation
chmod 755 file_name
Symbolic: rwxr- xr- x
Binary: 111101101
Octal: 755
Interpretation
user / ownergroupother
can* read
* write
* execute
* read

* execute
* read

* execute
symbolicrwxr- xr- x
binary 111101101
octal755
Hit the Advanced mode button to check additional special modes.
Check out 32 similar tech and electronics calculators 💻
3D printing costAmdahl's lawBattery capacity… 29 more
People also viewed…

Christmas tree

Welcome to the Christmas tree calculator, where you will find out how to decorate your Christmas tree in the best way. Take a look at the perfect Christmas tree formula prepared by math professors and improved by physicists. Plan in advance how many lights and decorations you'll need!

Circumference

Use this free circumference calculator to find the area, circumference and diameter of a circle.

Hamming code

With our Hamming code calculator you will be able to encode a message using linear codes, detect errors and more!

Projector

The projector calculator finds the optimum viewing distance and throw distance for a specific projection size.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service