chmod Calculator & Linux Permissions
Calculate and convert file permissions in real-time.
Quick Presets
Numeric Input
Enter 3 or 4 octal digits (0–7), such as 644, 755 or 2775. The optional first digit sets setuid (4), setgid (2) and the sticky bit (1).
Permission Grid
Output
000 --------- chmod 000 filename Umask Calculator
The umask sets the default permissions of new files and directories. Every bit set in the umask is removed from the base permissions (base AND NOT umask), so umask 027 turns 666 into 640, not 639. All values are octal.
644 755 What the chmod Calculator Does
chmod (change mode) is the Unix and Linux command that sets who can read, write and execute a file or directory. This chmod calculator translates between the octal form that chmod accepts, such as 755 or 4755, and the rwx string you see in ls -l output, then builds the command for you. It is handy when you deploy to a Linux server, fix a "Permission denied" error, or lock down SSH keys.
How to Use the Calculator
- Start from a Quick Presets button (644, 755, 777, 600, 700, 664, 666 or 444), tick the Read, Write and Execute boxes for Owner (User), Group and Others (World) in the Permission Grid, or type a three- or four-digit octal value such as 640 or 2775 into Numeric Input. The calculator updates as soon as the value is complete, and a message under the field explains anything it cannot read, such as an 8 or 9.
- Read the result under Output: Octal Notation and Symbolic Notation. Each row of the grid also shows its own digit.
- Click Copy Command to copy a line such as
chmod 755 filename, and replacefilenamewith your file or directory path. - Use Reset to clear every box and start again.
- In the Umask Calculator, enter a Umask Value with the File Base and Directory Base to see the default permissions for new files and directories. All three are octal, so 22, 022 and 0022 mean the same umask.
How Octal Digits Map to rwx
Each permission has a value: read is 4, write is 2 and execute is 1. Add the values you want to get one digit from 0 to 7. A mode has three digits, in this order: owner, group, others. So 754 means the owner has 7 (4+2+1, rwx), the group has 5 (4+1, r-x), and everyone else has 4 (r--), which is written rwxr-xr--.
| Digit | Binary | Symbolic | Permissions |
|---|---|---|---|
| 0 | 000 | --- | None |
| 1 | 001 | --x | Execute |
| 2 | 010 | -w- | Write |
| 3 | 011 | -wx | Write, execute |
| 4 | 100 | r-- | Read |
| 5 | 101 | r-x | Read, execute |
| 6 | 110 | rw- | Read, write |
| 7 | 111 | rwx | Read, write, execute |
The symbolic output shows the nine permission characters. In ls -l a tenth character comes first and gives the file type: - for a file, d for a directory.
Common Permission Settings
| Mode | Symbolic | Typical use |
|---|---|---|
| 644 | rw-r--r-- | Regular files, web pages, most configs |
| 755 | rwxr-xr-x | Directories, scripts, programs |
| 600 | rw------- | Private keys, .env files with secrets |
| 700 | rwx------ | ~/.ssh and other private directories |
| 664 / 775 | rw-rw-r-- / rwxrwxr-x | Files and folders a team group edits |
| 444 | r--r--r-- | Read-only for everyone |
| 777 | rwxrwxrwx | Avoid: anyone can change the file |
Permissions on Directories
The same bits mean something different on a directory. Read lets you list the names inside it, write lets you create, delete and rename entries, and execute lets you enter the directory and reach files inside it by name. That is why directories almost always need the x bit: a folder set to 644 cannot be entered, even by its owner. It also explains why deleting a file depends on write permission for the directory, not on the file's own mode.
Be careful with chmod -R 755 on a whole project, because it makes every file executable too. A common fix is to set directories and files separately:
find site -type d -exec chmod 755 {} +
find site -type f -exec chmod 644 {} + chmod also accepts symbolic changes that adjust only the bits you name, such as chmod u+x deploy.sh (add execute for the owner) or chmod go-w notes.txt (remove write for group and others). A numeric mode, like the one this calculator produces, always sets all nine bits at once.
Setuid, Setgid and the Sticky Bit
chmod also understands an optional fourth digit placed in front of the other three. Setuid is 4, setgid is 2 and the sticky bit is 1. For example, 4755 shows as rwsr-xr-x and runs a program with its owner's privileges, 2775 shows as rwxrwsr-x and makes new files in a directory inherit the directory's group, and 1777 shows as rwxrwxrwt (the mode of /tmp) so users can only delete their own files.
Tick Setuid, Setgid or Sticky under Special Bits, or type a four-digit mode, and the calculator adds the digit to the octal value and the command and shows s or t in place of the x. A capital S or T, as in 6644 (rwSr-Sr--), means the special bit is set but the execute bit under it is not, which is usually a mistake. A leading 0, as in 0755, means no special bits, so the calculator shows it as 755. One catch on Linux: GNU chmod keeps an existing setuid or setgid bit on a directory when you give a numeric mode such as 755 or 0755. Use chmod g-s dir or a five-digit mode such as 00755 to clear it.
How Umask Works
The umask decides the permissions of newly created files. Programs usually request 666 for files and 777 for directories, and every bit that is set in the umask is removed from that request. In other words, the result is the base mode with the umask bits masked off (base AND NOT umask), not a plain subtraction. The Umask Calculator above works this way:
| Umask | New files | New directories |
|---|---|---|
| 022 | 644 | 755 |
| 002 | 664 | 775 |
| 027 | 640 | 750 |
| 077 | 600 | 700 |
For 022 and 002, subtracting digit by digit happens to give the same answer, which is why the shortcut is popular. It breaks for a umask like 027: the group loses write (6 becomes 4) and others lose everything (6 becomes 0), so new files get 640, while digit-by-digit subtraction gives a meaningless result. Because files start from 666, a umask never makes a new file executable; you add that with chmod afterwards.
Frequently Asked Questions
How do I make a file executable?
Run chmod u+x script.sh to add execute for the owner only, or chmod 755 script.sh to let everyone run it while only you can edit it. If the script will run from cron, it needs the execute bit too; the cron expression generator helps with the schedule. If you downloaded the script, compare its checksum with the hash generator before you run it.
What's the difference between 644 and 755?
Both let only the owner write. 755 adds execute for everyone, which programs and scripts need in order to run and directories need in order to be opened. Use 644 for ordinary files and 755 for directories and executables.
Why is chmod 777 a bad idea?
777 lets every user on the system modify or replace the file, so on a web server any compromised process can rewrite your code. If a "Permission denied" error tempts you to use it, fix the owner or group with chown instead.
What permissions should SSH keys have?
Use 700 for the ~/.ssh directory, 600 for private keys and authorized_keys, and 644 for public keys. OpenSSH refuses to use a private key that other users can read and warns about an unprotected private key file.
What permissions do website files need?
Typically 644 for files and 755 for directories, with files containing passwords or API keys set to 600 or 640 and owned by the application's user. If the web server's user cannot read a file, visitors get a 403 Forbidden status.
Does this calculator change any files?
No. It only calculates values and builds the command text in your browser. Nothing is sent to a server, and nothing changes until you run the command in your own terminal.
Love using BreezyTools?
Go Pro for an ad-free experience, priority features, and support independent development — for less than a coffee a month.