Skip to main content
Ubuntu Blog
Search

Search

Chmod Calculator: Octal and Symbolic Permissions

Author: First published

A chmod mode is one to four octal digits. Each of the last three digits adds read (4), write (2) and execute (1) for the owner, the group and everyone else; an optional first digit adds setuid (4), setgid (2) and the sticky bit (1). This calculator converts that number to the rwx form that ls -l shows, accepts symbolic modes such as u=rwx,go=rx, applies a umask, and writes out the chmod command.

Chmod calculator

Choose how you want to enter the permissions, then fill in that part of the form. Results update as you type and are saved in the page address. Nothing leaves your browser.

Permissions

One to four digits from 0 to 7, such as 644 or 4755.

Letters ugoa, an operator + - =, then rwxXst or one of u, g, o. Separate clauses with commas, for example u+x,g-w.

The file's current mode. It matters for +, - and X, and for = on setuid or setgid.

Run umask in a terminal to see yours. 022 is the typical default. It changes the symbolic result when you leave out ugoa, and drives the umask rows.

Names with spaces or special characters are quoted for you.

Permissions

How the chmod calculator works

A file's permission bits are stored as a number. chmod accepts that number as octal digits, or as a symbolic description of the change. The calculator turns either form, or the checkboxes, into the same number and then prints it every way you are likely to need: octal, the ten-character string from ls -l, the access each group of users gets, and the matching chmod commands.

Octal digits
digit = (4 if read) + (2 if write) + (1 if execute)
mode  = [special] [owner] [group] [others]
special = (4 if setuid) + (2 if setgid) + (1 if sticky)
new file mode = 666 with the umask bits removed;  new directory = 777 with the umask bits removed
owner, group, others
the file owner, other users in the file's group, and users in neither
umask
bits turned off when something is created, as in 0666 & ~022 = 0644

Example 1: 754 to symbolic

Worked example

Given: chmod 754 script.sh.

  1. Owner digit 7: 4 + 2 + 1 = rwx
  2. Group digit 5: 4 + 1 = r-x
  3. Others digit 4: 4 = r--

Answer: 754 is rwxr-xr--: the owner can read, write and execute; the group can read and execute; everyone else can only read.

Example 2: what a new file gets under umask 022

Worked example

Given: new file requested as 666; umask 022.

  1. Remove the umask bits: 666 & ~022 = 644
  2. A new directory, requested as 777: 777 & ~022 = 755

Answer: Files come out as 644 (rw-r--r--) and directories as 755 (rwxr-xr-x).

Example 3: symbolic to octal with a special bit

Worked example

Given: chmod u=rwxs,g=rx,o= tool.

  1. Owner rwx plus setuid: 4000 + 700
  2. Group r-x: 50
  3. Others nothing: 0

Answer: The mode is 4750, shown by ls -l as rwsr-x---.

Digits and special bits

What each octal digit grants
DigitSumLetters
0 0---
1 1--x
2 2-w-
3 2 + 1-wx
4 4r--
5 4 + 1r-x
6 4 + 2rw-
7 4 + 2 + 1rwx

Source 1: read (4), write (2) and execute (1) are added for each class.

The first digit of a four-digit mode
ValueBitShown by ls -l as
4 Setuid (set user ID)s in the owner execute slot
2 Setgid (set group ID)s in the group execute slot
1 Sticky bit (restricted deletion flag)t in the others execute slot

Source 1. A capital S or T means the bit is set but the execute bit under it is not.

Some common modes
Octalls -l permissions
644 rw-r--r--
755 rwxr-xr-x
600 rw-------
700 rwx------
664 rw-rw-r--
775 rwxrwxr-x
4755 rwsr-xr-x
2775 rwxrwsr-x
1777 rwxrwxrwt

Computed from the digit values above. Source 1 notes the sticky bit is commonly found on world-writable directories like /tmp.

Setuid, setgid, sticky and umask notes

  • chmod clears the set-group-ID bit of a regular file if the file's group ID does not match your effective group ID or one of your supplementary group IDs, unless you have appropriate privileges. Additional restrictions may cause setuid and setgid to be ignored, and the manual advises checking the underlying system behaviour when in doubt (source 1).
  • On directories, chmod keeps the setuid and setgid bits unless you say otherwise. With a numeric mode, write 00755, -6000 or =755 to clear them (source 1).
  • With no ugoa letters, a symbolic mode acts as if a were given, but bits set in the umask are not affected. The calculator uses the umask field for that.
  • The umask turns bits off in the mode requested when a file or directory is created (source 2). The calculator applies it to symbolic modes without ugoa letters (source 1) and to the new-file rows.
  • If the parent directory has a default ACL, the umask(2) manual says the umask is ignored and the default ACL is inherited (source 2).

Assumptions and limits

  • The calculator follows the chmod(1) and umask(2) pages of the Ubuntu 24.04 manual, as read on 2026-11-13. It does not run chmod and cannot see your files.
  • A new file is shown as requested with mode 666, the example the umask(2) page uses; a program can request another mode.
  • Access control lists, file attributes, mount options and Linux security modules can all change who may do what. This tool covers the permission bits only.
  • Permissions are a security control. Mode 777, and any mode that gives write to others, lets every user on the machine change the file. Prefer the narrowest mode that works.

Frequently asked questions

What does chmod 755 mean?

The digits are owner, group and others. 7 is 4+2+1, so the owner gets read, write and execute. 5 is 4+1, so the group and everyone else get read and execute. ls -l shows it as rwxr-xr-x.

What does chmod 644 mean?

6 is 4+2, read and write for the owner. 4 is read only, for the group and for everyone else. ls -l shows rw-r--r--. It is also what a new file ends up with under the common 022 umask, because 666 with the 022 bits removed is 644.

How do I convert rwxr-xr-x to octal?

Take each group of three letters on its own and add read 4, write 2 and execute 1 for every letter that is present. rwx is 7, r-x is 5, r-x is 5, so rwxr-xr-x is 755. Put a fourth digit in front for setuid, setgid or the sticky bit.

What do the setuid, setgid and sticky bits do?

They are the first digit of a four-digit mode: setuid is 4, setgid is 2 and the sticky bit is 1. The chmod manual describes the sticky bit, which it calls the restricted deletion flag, on a directory as preventing unprivileged users from removing or renaming a file in it unless they own the file or the directory, and says it is commonly found on world-writable directories such as /tmp. ls -l shows setuid and setgid as an s in place of the owner or group x, and the sticky bit as a t in place of the others x. A capital S or T means the bit is set without the execute bit beneath it.

What does umask do?

The umask turns permission bits off when a new file or directory is created. The umask(2) manual gives the example 0666 & ~022 = 0644. A new file is typically requested with mode 666 and a new directory with 777, so the usual 022 umask gives files 644 (rw-r--r--) and directories 755 (rwxr-xr-x). The calculator shows both results for the umask you enter.

Why does chmod 755 not clear setuid on a directory?

The chmod manual says that for directories chmod preserves the set-user-ID and set-group-ID bits unless you explicitly specify otherwise. To clear them with a numeric mode you need an extra leading zero (00755), a leading minus such as -6000, or a leading equals such as =755.

What is the difference between u+x and a+x?

u+x adds execute for the owner only; a+x adds it for the owner, group and others. With no letters before the operator, as in +x, chmod acts as if a were given, except that bits set in the umask are not changed. Choose "Symbolic" in the calculator, enter a starting mode and your change, and it shows the result.

What does the capital X do?

It sets execute (search) only if the file is a directory or already has execute permission for some user. It is the usual way to give directories access without making every plain file executable, as in chmod -R a+rX.

Sources

  1. Ubuntu manpages: chmod(1), numeric and symbolic modes, setuid, setgid and the sticky bit (manpages.ubuntu.com) Ubuntu 24.04 (Noble). Accessed 2026-11-13.
  2. Ubuntu manpages: umask(2), how the umask is applied to a mode (manpages.ubuntu.com) Ubuntu 24.04 (Noble). Accessed 2026-11-13.
  3. Ubuntu manpages: mkdir(1), default directory mode a=rwx minus the umask (manpages.ubuntu.com) Ubuntu 24.04 (Noble). Accessed 2026-11-13.

Related guides