Productivity and Utilities

Umask Calculator

Enter a umask, or the directory permissions you want, to see the default permissions of new files and directories.

Your numbers

Start from

An octal umask with three or four digits such as 022 or 0027, or the symbolic form shown by umask -S, such as u=rwx,g=rx,o=rx. For a directory mode, three or four octal digits such as 755.

Result

umask

022

New files get 644 (rw-r--r--) and new directories get 755 (rwxr-xr-x).

umask (octal)
022
umask (symbolic, as umask -S)
u=rwx,g=rx,o=rx
New file permissions
644 (rw-r--r--)
New directory permissions
755 (rwxr-xr-x)
Bits removed by the umask
----w--w-
Command
umask 022
How this was calculated
  1. A program that creates a file asks for 666 (read and write for everyone). For a directory it asks for 777.
  2. The umask removes bits: result = requested AND NOT umask. With umask 022, 666 becomes 644 and 777 becomes 755.
  3. Files never gain the execute bit from a umask, because the requested mode has none. Setuid, setgid and sticky bits are not affected by the three digit part.
  4. The symbolic form lists the permissions that stay allowed, the opposite of the octal mask.
  • Programs may ask for other modes than 666 and 777, and some filesystems or access control lists change the result. Check with ls -l on a real file.

Calculated using SumPanda.com · https://sumpanda.com/umask-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the umask calculator

  1. Choose to start from a umask or from a wanted directory mode.
  2. Enter the value: an octal umask such as 022, a symbolic one such as u=rwx,g=rx,o=rx, or directory permissions such as 755.
  3. Read the permissions that new files and new directories get, and the umask command to use.
  4. Compare the octal and the symbolic forms to see how they relate.

Formula

file permissions = 666 AND NOT umask

directory permissions = 777 AND NOT umask

umask for a wanted directory mode = 777 AND NOT mode

symbolic umask (umask -S) lists the permissions that stay allowed

Programs usually ask for 666 when they create a file and 777 when they create a directory. The umask removes bits from that request. Only the last three octal digits are used.

The common values 022, 077 and 002

With umask 022, new files get 644 (rw-r--r--) and new directories get 755 (rwxr-xr-x). The symbolic form is u=rwx,g=rx,o=rx. The bits removed are the write bits for group and others.

With umask 077, files get 600 and directories get 700, so only the owner has access. With umask 002, files get 664 and directories get 775, which suits a group that shares files. If you want new directories to be 775, the page gives umask 002, and new files then get 664.

Why files never get the execute bit

A file creation call usually asks for mode 666, which has no execute bits. The umask can only remove bits, never add them, so a new file does not become executable by default. You make a script executable on purpose with chmod. Directories need the execute bit to be entered, so programs ask for 777, and the umask trims that.

The umask belongs to a process and is inherited by the programs it starts. A value set in a shell profile applies to files made from that shell. Services and cron jobs may have their own umask.

Related tools

To set the mode of a file that already exists, use the Chmod Calculator. To work with masks of your own, try the Bit Field Mask Generator and the Bitwise Calculator.

Assumptions and limits

  • Files are requested with mode 666 and directories with mode 777.
  • Only the last three octal digits of the umask are used.
  • Access control lists and special filesystems can change the result.
  • Special bits such as setuid, setgid and sticky are not covered.
  • The umask shown when the page opens is an example.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What does umask 022 do?

It removes write permission for the group and for others. New files become 644 and new directories become 755, so only the owner can change them.

Is the umask the same as the permissions?

No, it is the opposite. The permissions are what remains after the umask removes bits, so a larger umask gives stricter permissions.

What do the four digits in 0022 mean?

On Linux only the last three digits change permissions. The first digit has no effect on new files, so 0022 and 022 are the same.

Can I get a new file with the execute bit?

Not from the umask alone. A program must ask for it. Most create files with mode 666, which leaves execute off until you use chmod.