Umask calculator

The umask removes permissions from the defaults of 666 for files and 777 for directories. A umask of 022 removes write for group and others, so new files are 644 and new directories 755.

ReadWriteExecute

    Apply a symbolic change

    umask

    Common permissions

    Saved you some time? Leave a tip, entirely optional.

    Type a umask below to see what it produces.

    How Unix permissions work

    Every file and directory on Linux, macOS and other Unix-like systems has an owner, a group and three sets of permissions: one for the owner (u), one for members of the group (g) and one for everyone else (o). Each set has three bits: read (r), write (w) and execute (x). Running ls -l shows them as a ten-character string such as -rwxr-xr-x, where the first character is the file type and the next nine are the permission bits. ChmodCalc lets you set those bits with checkboxes and shows the matching octal number and symbolic string at the same time.

    Octal notation

    The chmod number packs each set into one digit by adding read = 4, write = 2 and execute = 1. So 7 is rwx, 6 is rw-, 5 is r-x and 4 is r--. A mode of 755 is rwx for the owner and r-x for the group and others, and 644 is rw- for the owner and r-- for everyone else. A leading fourth digit sets the special bits: 4 for setuid, 2 for setgid and 1 for the sticky bit, so 4755 is a setuid program and 1777 is a world-writable directory with the sticky bit, like /tmp.

    Files versus directories

    On a file, read lets you open it, write lets you change it and execute lets you run it as a program or script. On a directory, read lets you list the names inside, write lets you create, delete and rename entries, and execute lets you enter the directory and access the files in it. That is why directories usually need the execute bit wherever they have read, and why a common pattern is 755 for directories and 644 for files.

    Symbolic changes and umask

    Instead of setting the whole mode, chmod can change individual bits with symbolic expressions: chmod u+x script.sh adds execute for the owner, chmod go-w file removes write for group and others, and chmod a=r file sets read-only for everyone. The umask controls the permissions of newly created files by removing bits from 666 for files and 777 for directories. The default umask of 022 gives 644 files and 755 directories. Nothing you enter here touches your system; copy the command and run it yourself.

    Frequently asked questions

    How do I check my umask?

    Run umask in a terminal.

    Why don’t files get execute?

    Files start from 666, so the umask can never add execute.

    What umask is private?

    077, giving 600 files and 700 directories.

    Is ChmodCalc free?

    Yes, with no sign-up or ads.

    Does it change my files?

    No. It only builds commands for you to run yourself.

    More tools