Live tool

umask Calculator

Calculate resulting file and directory permissions from a Linux umask value, inspect numeric and symbolic outputs, use reverse lookup for target modes, and review live previews, permission cuts, bit-level breakdowns, 3-digit and 4-digit notation, and shareable URLs.

Input

Live calculation, no page reload, reverse lookup, and shareable URL updates.

Accepts 3-digit and 4-digit octal values. Examples: 022, 027, 077, 0022
Security Moderate
Used in the ls -l preview and chmod command preview.
Used in the directory preview and command output.
Common presets
Reset
Live mode updates the result as you type and rewrites the query string automatically.

Shell snippet generator

Copy ready-to-paste snippets for a user shell or a system-wide profile.

~/.bashrc
# ~/.bashrc
umask 022
/etc/profile
# /etc/profile
umask 022

Result

File and directory output, ls -l previews, bit-level breakdown, and the permission-cut matrix.

umask 022
Padded form: 0022
Files 644
rw-r--r--
Directories 755
rwxr-xr-x
ls -l preview — file
-rw-r--r-- 1 user group demo-file.txt
With umask 022, new files typically end up as 644 (rw-r--r--).
ls -l preview — directory
drwxr-xr-x 2 user group demo-directory
With umask 022, new directories typically end up as 755 (rwxr-xr-x).
Bit-level breakdown — files
0666 & ~0022 = 0644
New regular files start from 0666, so execute bits are not granted by default.
Bit-level breakdown — directories
0777 & ~0022 = 0755
New directories start from 0777, so execute bits can remain after masking.

Permission matrix

Colored cells show which permission bits the current umask removes.

Cut by umask Not cut
r
w
x
Owner
r
w
x
Group
r
w
x
Others
r
w
x
Quick explanation

umask 022 removes permissions from the default creation modes. Files start from 0666 and directories start from 0777, so the same mask produces different final results.

Reverse lookup and interactive builder

Set the final permission target and the calculator returns the required umask.

Target type
File mode accepts values derived from 0666, so execute bits are intentionally blocked.
Required umask
026
0666 & ~0026 = 0640
Permission toggles
r
w
x
Owner
Group
Others
Target symbolic: rw-r-----

Expanded presets table

Common umask values with ready-to-apply examples for files, directories, and typical usage.

Umask Files Dirs Use case
022 644 755 Default Linux
002 664 775 Collaborative
027 640 750 Moderate security
077 600 700 Maximum privacy
007 660 770 Owner + group full
0022 644 755 4-digit padded form

Related tool

Translate final permissions into chmod notation.

Need to convert a final permission value like 755 or rwxr-xr-x into chmod notation?

Open chmod Calculator

How umask works

The same mask gives different file and directory results because the starting modes are different.

Default file mode

Files usually start from 0666.

Default directory mode

Directories usually start from 0777.

Practical example

022 usually becomes 644 for files and 755 for directories.