Skip to content
Omnikalc

Chmod calculator: pick the permissions and get the octal mode

Tick read, write and execute for the owner, the group and others, add a special bit if needed, and get the octal number to use with the chmod command.

Updated on
Your inputs

Results

Octal mode for chmod

755

Only the owner can write
Owner digit
7
Group digit
5
Others digit
5

Unix and Linux permissions fit in three digits, and the maths behind them is simple but easy to forget. This chmod calculator lets you pick read, write and execute for the owner, group and others, adds an optional special bit, and gives the octal mode to type after chmod.

How the calculation works

  • Each class (owner, group, others) gets a digit from 0 to 7: read counts 4, write counts 2, execute counts 1, and the digit is their sum.
  • Mode = owner digit, group digit, others digit, written one after another. Owner read, write and execute with group and others read and execute is 7, 5, 5.
  • Special bits add a leading digit: 4 for setuid, 2 for setgid and 1 for the sticky bit. A mode such as 1777 is a sticky shared directory.
  • Command to apply the result: chmod 755 file, or chmod -R 755 folder to change a whole directory tree.
  • Symbolic form: the same permissions can be written as letters, for example rwxr-xr-x for 755.

Example

A web server script should be readable and executable by everyone but changeable only by its owner. Owner: read 4 + write 2 + execute 1 = 7. Group: read 4 + execute 1 = 5. Others: read 4 + execute 1 = 5. The mode is 755, the command is chmod 755 script.sh, and the symbolic form is rwxr-xr-x.

Why it matters

Permission mistakes are among the most common causes of web server errors, failed deployments and security problems. Too tight, and a script will not run or a site shows a 403 error. Too loose, and any user or any compromised program can change your files. Building the mode from the three questions of who can read, write and run makes the right number obvious.

Good to know

The calculator covers the classic permission bits. Real systems add access control lists, file ownership, extended attributes and mandatory access control such as SELinux, which can allow or deny access regardless of the mode. Directories treat execute as the right to enter them, and write on a directory means the right to add or remove files. Use the least permissive mode that works, and keep private keys and configuration files at 600 or 400.

The subnet calculator covers another everyday admin task, the password strength calculator shows how long a password would resist guessing and the hash collision calculator estimates the risk of duplicate identifiers.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute, while the group and others can read and execute but not write. It is the usual mode for directories and for programs that anyone may run.

What does chmod 644 mean?

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

Why avoid chmod 777?

It lets any user on the system read, change and run the file. It is a common quick fix that creates a serious security hole, especially on a web server.

What are setuid, setgid and the sticky bit?

Setuid makes a program run with its owner’s rights, setgid does the same for the group or makes new files inherit the directory’s group, and the sticky bit on a directory stops users from deleting each other’s files, as in /tmp.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.