Free online tools to generate, calculate,
convert, format, encode, and play.
 

Umask Calculator

Calculate effective file and directory permissions after applying a umask value. See exactly which permission bits are masked off.


Umask Value

Owner
Group
Others
Read
Write
Execute
Owner
Group
Others

Effective Permissions

New Files (base 666)
Octal: 644
Symbolic: rw-r--r--
ls -l: -rw-r--r--
Read (4)
Write (2)
Execute (1)
Base (666)
r
w
—
Umask
—
—
—
Result (Owner)
r
w
—
Base (666)
r
w
—
Umask
—
w
—
Result (Group)
r
—
—
Base (666)
r
w
—
Umask
—
w
—
Result (Others)
r
—
—
New Directories (base 777)
Octal: 755
Symbolic: rwxr-xr-x
ls -l: drwxr-xr-x
Read (4)
Write (2)
Execute (1)
Base (777)
r
w
x
Umask
—
—
—
Result (Owner)
r
w
x
Base (777)
r
w
x
Umask
—
w
—
Result (Group)
r
—
x
Base (777)
r
w
x
Umask
—
w
—
Result (Others)
r
—
x
umask 022
umask -S
umask u=rwx,g=rx,o=rx

How Umask Works

What is umask?

The umask (user file-creation mode mask) is a value that determines which permission bits are removed from newly created files and directories. It acts as a filter that strips away permissions you don't want granted by default.

Default Base Permissions
  • Files: 666 (rw-rw-rw-) — read and write for all, no execute
  • Directories: 777 (rwxrwxrwx) — read, write, and execute for all

Files don't get execute permission by default because it would be a security risk to make every new file executable.

The Calculation

The effective permissions are calculated with a bitwise AND-NOT operation:

effective = base AND (NOT umask)

Example with umask 022:
  Files:       666 AND (NOT 022) = 666 AND 755 = 644 (rw-r--r--)
  Directories: 777 AND (NOT 022) = 777 AND 755 = 755 (rwxr-xr-x)
Common Umask Values
  • 022 — Default on most systems. Files: 644, Dirs: 755. Owner has full access, others can read
  • 027 — Restrictive. Files: 640, Dirs: 750. Group can read, others have no access
  • 077 — Private. Files: 600, Dirs: 700. Only owner has access
  • 002 — Group-friendly. Files: 664, Dirs: 775. Group has same access as owner
Setting Umask Permanently

To persist your umask across sessions, add the umask command to your shell profile:

  • Bash: ~/.bashrc or ~/.bash_profile
  • Zsh: ~/.zshrc
  • System-wide: /etc/profile or /etc/login.defs
Symbolic Notation

The umask -S command shows the umask in symbolic form, displaying the permissions that will be set (the inverse of what's masked). For example, umask 022 in symbolic form is u=rwx,g=rx,o=rx.


Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with