Skip to main content
NyankoTools

umask Calculator

Enter a umask (for example 022) to see the permissions that new files (base 666) and new directories (base 777) will get, in both octal and rwx notation. You can also work backwards: type the permissions you want, such as 644 for files or 750 for directories, and the tool tells you which umask to set. To convert permissions on existing files, use the Chmod Permission Calculator. Everything runs in your browser and nothing is sent to a server.

🔒 Runs in your browser · Your data is never sent to a server

New file (base 666)

New directory (base 777)

Find the umask for the permissions you want

Enter the permissions you want new files or directories to have, and get the umask that produces them.

Type

Common umask values

umaskFileDirectoryTypical use
022644 (rw-r--r--)755 (rwxr-xr-x)Default on most Linux systems; only you can write
002664 (rw-rw-r--)775 (rwxrwxr-x)Shared group editing (e.g. regular users on Debian/Ubuntu)
027640 (rw-r-----)750 (rwxr-x---)Group can read only; others get nothing
077600 (rw-------)700 (rwx------)Private to you (keys, server accounts)
000666 (rw-rw-rw-)777 (rwxrwxrwx)No restriction (not recommended)

Notes

  • Files use 666 as the base because normal file creation never sets the execute bit. Execute bits in the umask do not change the result for new files.
  • The umask can be entered as 022, 22, or 0022. A 4-digit value is only accepted when its first digit is 0.
  • The real result also depends on the creation mode a program requests (for example 0600). This tool uses the usual bases: 666 for files and 777 for directories.
  • On directories with a default ACL, the ACL may take precedence over the umask.

Glossary

umask

A mask that removes permissions from newly created files and directories. The permissions actually granted are the base permissions minus the bits set in the umask.

Base permissions (666 and 777)

New files start at 666 (rw-rw-rw-, no execute) and new directories at 777 (rwxrwxrwx). The umask then strips bits from that starting point.

Octal and rwx notation

Add read = 4, write = 2, execute = 1 for each of owner, group, and other to get three octal digits. rwx notation expresses the same thing in nine characters.

FAQ

What permissions do new files get with umask 022?

New files get 644 (rw-r--r--), which is 666 with the 022 bits removed, and new directories get 755 (rwxr-xr-x), which is 777 with those bits removed.

Why is the base for files 666 instead of 777?

Normal file creation never sets the execute bit. A umask can only remove permissions, never add them, so new files never become executable on their own; use chmod when you need that.

Is umask really a subtraction?

Strictly it is a bit mask (base AND NOT umask). For values like 022 or 077 it matches subtraction, but it differs when the umask has execute bits that the file base 666 does not contain (for example 011).

How long does a umask setting last?

Running umask in a shell only affects that session. To make it permanent, set it in ~/.bashrc or ~/.profile, or system-wide in a file such as /etc/login.defs.

Share this page

↑↓ Select Enter Open Esc Close