Umask Calculator
Enter a umask value to see the resulting default file and directory permissions.
Result
How it is calculated
A umask is a mask of permission bits to remove. New files start from 666 and new directories from 777, so file mode = 666 & ~umask and directory mode = 777 & ~umask. Each octal digit covers one class, in order: owner, group, others, and within a digit read 4 = read, 2 = write, 1 = execute. A bit set in the umask is cleared in the result.
The input must be three or four octal digits (0 to 7 only). With four digits, only the last three are used, because the tool keeps just the permission bits. A value such as 089 or 22 is not accepted. Files start from 666, not 777, so a umask can never make a new regular file executable; that is why files and directories differ even under the same mask. The result is shown in octal and in the usual rwx text form.
Worked example
Enter the umask 027. Owner digit 0 removes nothing; group digit 2 removes write; others digit 7 removes everything. For files, 666 gives owner rw, group rw minus w = r, others none, which is 640 (rw-r-----). For directories, 777 gives owner rwx, group r-x, others none, which is 750 (rwxr-x---). So the owner keeps full access, the group can read and enter, and everyone else is shut out.
Common mistakes
- Thinking the umask is the permission itself. It is the set of bits taken away, so 022 gives 644 for files, not 022.
- Subtracting the digits as ordinary numbers. A umask is a bitwise operation: 666 minus 027 would be wrong, while 666 & ~027 gives 640.
- Expecting new files to be executable. Files start from 666, so even umask 000 leaves 666 and the x bit has to be added with chmod.
- Typing a digit 8 or 9, or only two digits such as 22. Only octal digits are accepted, in groups of three or four.
- Assuming the umask changes existing files. It applies only to files and directories created afterwards by that process.
About this calculator
On Linux and Unix systems, new files and directories start from maximum default permissions — 666 (rw-rw-rw-) for files and 777 (rwxrwxrwx) for directories — and the umask value subtracts specific permission bits from that maximum using a bitwise AND with the complement of the mask. A umask of 022, for example, strips group and other write permission, leaving new files at 644 and new directories at 755.
System administrators and developers set the umask in shell profiles or service configs to control the default access level of everything a process creates, which matters for security on shared servers and multi-user systems.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
A umask only takes permissions away, never adds them, and a program may still ask for stricter modes on its own, as SSH does for private keys. For a folder shared by a group, 002 gives files 664 and directories 775 so teammates can write, while 077 keeps everything private to the owner. Typing umask in your shell shows the current value. What setup are you trying to get right, a shared project or a web root?