Umask Calculator

Enter a umask in octal (022) or symbolic form (u=rwx,g=rx,o=rx) to see the permissions that new files and new directories get. Or enter the permissions you want and get the umask that produces them. Everything runs in your browser.

How the umask works

  • The umask is a file mode creation mask. The Linux manual page umask(2) says the permissions in the umask are turned off from the mode argument given to open(2) and mkdir(2), and that only the nine permission bits are used (mask AND 0777).
  • New files are normally requested with mode 0666 (read and write for everyone, no execute) and new directories with 0777. So a new file gets 666 AND NOT umask and a new directory gets 777 AND NOT umask.
  • The manual page gives the example 0666 and NOT 022 = 0644. With the common umask 022, files get 644 (rw-r--r--) and directories get 755 (rwxr-xr-x).
  • It is a bit mask, not a subtraction. With umask 033, files get 644, not the 633 that 666 minus 033 would suggest, because the umask can only clear bits that are set.
  • Because files start from 666, a umask can never give a new file an execute bit. Directories start from 777, so they keep execute unless the mask removes it.
  • The umask applies when a file or directory is created. It does not change the permissions of existing ones.

Symbolic form

The POSIX umask utility describes the mask in symbolic form as the permissions that are left alone. The example in the specification is that umask -S prints u=rwx,g=rwx,o=rx for the octal mask 0002. This calculator accepts the full form with = clauses for u, g and o (or a for all), such as u=rwx,g=rx,o=rx for 022. Relative forms such as g-w depend on your current umask, so they are not accepted here.

Common umask values

Umask Files Dirs umask -S
000 666 777 u=rwx,g=rwx,o=rwx
002 664 775 u=rwx,g=rwx,o=rx
007 660 770 u=rwx,g=rwx,o=
022 644 755 u=rwx,g=rx,o=rx
027 640 750 u=rwx,g=rx,o=
037 640 740 u=rwx,g=r,o=
077 600 700 u=rwx,g=,o=

Setting and checking it

Run umask in a shell to print the current mask and umask -S for the symbolic form. umask 027 sets it for that shell and the programs it starts. Where a login shell reads its default umask from depends on the system, so check your distribution's documentation.

Study and related tools

File permissions and umask appear on CompTIA Linux+, LPIC-1 and Linux Essentials. Try the free Linux+ XK0-006 practice test or the free LPIC-1 102-500 practice test, or read the Linux commands cheat sheet. Related: the chmod calculator and the free tools page.

Umask FAQ

What does umask 022 mean?
It removes write permission for the group and for others. New files get 644 and new directories get 755.

What umask gives 700 directories and 600 files?
077.

Why are my new files not executable?
New files start from 666, which has no execute bit, and the umask can only remove bits. Set the execute bit afterwards with chmod.

How is umask different from chmod?
chmod changes the permissions of an existing file. The umask sets which permissions are withheld from files and directories created from now on.

Behaviour follows the Linux man-pages umask(2) (man7.org/linux/man-pages/man2/umask.2.html) and the POSIX umask utility specification (pubs.opengroup.org/onlinepubs/9799919799/utilities/umask.html), checked on 8 November 2026. The tool was tested against 25 hand cases and against all 512 possible masks, comparing what a real Linux system (ext4) gave a new file, a new directory and the output of umask -S.