Calculate umask

Calculate the file and directory modes produced by a Unix umask.

freeworks offlinenothing uploaded
ToolUmask Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Regular files start from 0666 and directories from 0777; the umask removes permission bits from those baselines. Octal and symbolic forms are converted to the resulting mode while special bits stay separate.

  • The file-versus-directory baselines explain different execute results.
  • The defaults mirror POSIX process creation rules.

Worked example

The common 022 umask
Group and others lose write permission
Input
											022
										
Output
												File permissions octal: 644
File permissions symbolic: rw-r--r--
Directory permissions octal: 755
Directory permissions symbolic: rwxr-xr-x
											

When to use this

Shell profiles, Linux services, and container entrypoints calculate inherited permissions.

Edge cases

  • 022 yields 0644 files but 0755 directories.
  • Symbolic masks are interpreted by owner, group, and other classes.
  • Setuid, setgid, and sticky bits require separate mode handling.

References