Home › Tools › Umask Calculator

Umask Calculator

See the default file and directory permissions that any umask value produces.

About this tool

When you create a file on Linux or macOS, its permissions are not random. They come from a base value (666 for files, 777 for directories) minus a setting called the umask. A common umask of 022 produces files with mode 644 and directories with mode 755. A umask of 002 gives 664 and 775, which suits folders shared by a team.

This calculator takes any three-digit octal umask and shows the permissions that new files and new directories will receive, both in octal and in the familiar rwx notation. It also explains each digit, so you can see exactly which permission bits are being removed for the owner, the group and everyone else.

Files do not get the execute bit by default, which is a deliberate safety choice: a newly created file can never run as a program until someone allows it. Everything is calculated in your browser.

How to use it

  1. Type a three-digit umask such as 022, or use a preset.
  2. Read the resulting file and directory permissions.
  3. Use the breakdown to decide whether the value suits your server or shared folder.

A worked example

With umask 022, new files start from 666 and lose write for group and others, giving 644. New directories start from 777 and give 755. Switch to 002 for a shared project folder and files become 664 and directories 775, so teammates in the same group can edit each other's files.

Common mistakes

  • Thinking a larger umask digit grants more access. It removes more.
  • Setting umask in an interactive shell and expecting cron jobs or services to inherit it.
  • Expecting umask to override permissions that a program explicitly requests as narrower.

Frequently asked questions

What is the default umask on most Linux systems?

022 for regular users on many distributions, and 002 on some that give each user a private group. Run the umask command to see yours.

Does umask change existing files?

No. It only affects files and directories created afterwards.

Is a bigger umask more permissive?

No, the opposite. Each digit lists the permission bits to remove, so larger digits remove more.

Results are provided for general information. Please read our disclaimer.

More free tools