umask Calculator
Convert an octal or symbolic umask into the default permissions for newly created files and directories.
This tool handles input and primary processing in your browser and is designed not to send the input to QuickKit’s server.
Results
How it works
This tool assumes a requested mode of 0666 for files and 0777 for directories (the values programs usually pass to open(2) and mkdir(2)), then shows the permission bits remaining after applying the umask: mode AND NOT umask. Do not calculate a umask by subtraction. The familiar 0666 - umask / 0777 - umask only agrees with the real result when every bit of the umask is set in the requested mode, so that no borrow occurs; 0666 with umask 0111 gives 0666, not 0555. The symbolic form (as printed by umask -S) names the permissions that are KEPT; the octal form names the bits that are REMOVED. A umask only has the nine permission bits: umask(2) stores mask & 0777, so a leading setuid/setgid/sticky digit such as the 4 in 4022 is accepted but discarded, as the shell's umask builtin does. A program that requests a different mode, for example open(..., 0600), gets a different result, and ACLs, mount options, and inherited setgid directories can all change the final outcome; none of that is modeled here.