umask Calculator
Enter a umask such as 022 or 027 and see the permissions new files and directories get, in octal and rwx form, with the symbolic umask -S equivalent.
Free · No sign-up · Your inputs stay in your browser
Input
Work out what a umask creates
Output
Files 640, directories 750
New files
640 rw-r-----
New directories
750 rwxr-x---
Symbolic (umask -S)
u=rwx,g=rx,o=
A umask removes permission bits from the defaults programs ask for: 666 for files and 777 for directories. That is why no umask produces an executable file: execute has to be added with chmod. Set it for a service with UMask= in its systemd unit, and for a shell in ~/.profile.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Common values
022 gives 644 files and 755 directories: everyone can read, only the owner writes. 002 gives 664 and 775 for teams that share a group. 027 removes all access for others, a sensible default on servers, and 077 makes everything private. The umask(2) manual describes the mechanism.
Setting it for a service
A shell sets it in ~/.profile, but services started by systemd ignore your shell. Use UMask=0027 in the unit file, and PHP-FPM's or Nginx's own umask behaviour for files they write, such as uploads and logs.