Umask Calculator
See what default file and directory permissions any umask value produces, in octal and symbolic form — or work backwards from the permissions you want.
How it is computed
| File base | 666 | rw-rw-rw- |
| Directory base | 777 | rwxrwxrwx |
| Umask removes | 022 | ····w··w· |
| Result = base AND NOT umask | 644 / 755 | files / directories |
Shell command
umask 022
Add this to ~/.bashrc, ~/.zshrc or /etc/profile to make it permanent.
Reverse: find the umask for the permissions you want
Use umask 027 — directories become 750 (rwxr-x---) and files 640 (rw-r-----).
What is the Umask Calculator?
The ByteTools Umask Calculator shows exactly what default permissions new files and directories get under any umask.
- Computes default file (base 666) and directory (base 777) permissions for any umask
- Octal and symbolic (rwxr-xr-x) output for both
- Reverse mode: desired permissions to the umask that produces them
- Presets for the common values 022, 002, 027 and 077
- Shows the binary AND-NOT working so you can see why
- 100% client-side — nothing is uploaded
How to use the Umask Calculator
- 1
Enter a umask value in octal, such as 022, 002 or 077 — or click a preset.
- 2
Read the resulting default permissions for new files and new directories.
- 3
Check the symbolic strings and the umask command to add to your shell profile.
- 4
Use the reverse section to derive a umask from the directory permissions you want.
About the Umask Calculator
The ByteTools Umask Calculator shows exactly what default permissions new files and directories get under any umask. Enter a value like 022 and instantly see that files are created as 644 (rw-r--r--) and directories as 755 (rwxr-xr-x), with the bit-level working shown.
A umask is a mask of permissions to remove: new files start from a base of 666 and directories from 777, and every bit set in the umask is cleared from that base. The calculator does this AND-NOT math for you and also works in reverse — tell it the directory permissions you want and it derives the umask that produces them.
Everything is computed locally in your browser. It is a quick way to sanity-check a umask before putting it in a shell profile, a systemd unit or a Dockerfile.
Frequently asked questions
What does umask 022 do?
It removes write permission for group and others. New files become 644 (rw-r--r--) and new directories 755 (rwxr-xr-x). It is the default on most Linux distributions.
How is the umask applied, exactly?
The system starts from a base mode — 666 for files, 777 for directories — and clears every bit that is set in the umask (base AND NOT umask). The umask never adds permissions; it can only take them away.
Why do new files never get execute permission?
Because the file base is 666, which has no execute bits to begin with. The umask can only remove bits, so no umask can make files executable by default — you must run chmod +x explicitly. Directories use base 777, which is why they do end up executable (searchable).
What umask should I use for better security?
077 is the strictest common choice: files become 600 and directories 700, so only the owner can access them. 027 is a middle ground that keeps group read access while shutting out other users entirely.
How do I set my umask permanently?
Add a line like umask 022 to your shell startup file (~/.bashrc, ~/.zshrc or /etc/profile). For services, set UMask= in the systemd unit; for containers, set it in the entrypoint script.
Is umask 0022 the same as 022?
Yes. The leading zero is just octal notation — shells accept both. A four-digit umask can in principle mask the special bits too, but in practice file creation already ignores setuid/setgid from the base, so the last three digits are what matter.
Related tools
Chmod Calculator
Convert Linux file permissions between rwx checkboxes, octal values like 755 and symbolic strings — with setuid, setgid and sticky bit support. Free tool.
Cron Expression Generator
Build a cron expression from simple dropdowns — every N minutes, daily, weekly or monthly — with a plain-English summary. Free and 100% in your browser.
Bitwise Calculator
Calculate AND, OR, XOR, NOT and bit shifts on 32-bit values online. Enter operands in any base and see results in decimal, hex, octal and binary at once.
Binary Calculator
Do arithmetic and bitwise math on binary, decimal, hex and octal numbers — add, subtract, multiply, divide, AND, OR, XOR and shifts, with results in all bases.