Your files stay on your device

# umask calculator

See what a umask does before you set it: the bits it clears, and the file (0666) and directory (0777) modes that come out. A umask can only remove bits, never grant them.
Options

## Digits as permission bits

Each octal digit in a umask covers three bits: 4 for read, 2 for write, and 1 for execute. The digits apply in order to owner, group, and others. Every bit set in the umask is removed from the base mode, so a 2 in the group digit strips write from the group.

## Worked example at 027

Take 027. The owner digit is 0, so nothing comes off the owner. The group digit is 2, which removes write. The others digit is 7, which removes read, write, and execute. A new file starts at 0666 and ends at 0640. A new directory starts at 0777 and ends at 0750.

## Writing the mask backwards

Using 644 as the mask leaves new files at 0022: the owner has no access, and group and others can only write. To get 0644 files, the mask is 022, because 0666 with 022 removed is 0644.

## More config file tools

- [chmod calculator](/config/chmod)
- [docker run → compose](/config/docker)
- [.env editor](/config/env)
[All config file tools](/config)

Was this tool useful?
YesNo

---

Canonical HTML: https://nutter.tools/config/umask
Markdown version: https://nutter.tools/config/umask.md
Plain-text version: https://nutter.tools/config/umask.txt
Agent index: https://nutter.tools/llms.txt

