Chmod Calculator
A free Linux file permissions calculator. Tick read, write and execute for the owner, group and others, or type an octal or rwx value, and copy the chmod command. Common values: 644 for files, 755 for directories and scripts, 600 for private keys.
Free · No signupCalculated in your browser
3 or 4 octal digits · e.g. 755 or 4755
9 characters · optional file-type prefix, e.g. drwxr-xr-x
Advanced options Special bits
Numeric chmod can preserve existing setuid/setgid bits on directories. The symbolic command explicitly sets or clears all three special bits.
Replace filename with your target. Paths stay in this browser.
chmod 755 filenameCopy the command, then run it in your own terminal.
It works as a chmod generator and a chmod converter too: build a mode from the checkboxes, or turn rwx into octal and back.
A little less terminal work
Manage file permissions visually with CtrlOps.
In the CtrlOps File Manager, right-click a file or folder, click Permissions and tick read, write and execute for the owner, group and others, all over SSH. 14-day free trial, no credit card required. How to set file permissions.
Keep it handy
Common chmod values,
at a glance.
Start with the access your task needs. These are common examples; the right mode depends on the file, its owner and who needs to use it.
| Octal | Symbolic | Typical use | What it allows |
|---|---|---|---|
644 | rw-r--r-- | Regular files | Owner can edit; group and others can read. |
755 | rwxr-xr-x | Directories & executables | Owner can edit; everyone can read and execute or traverse. |
600 | rw------- | Private keys & secrets | Only the owner can read and write. |
700 | rwx------ | Private directories | Only the owner can read, write and traverse. |
640 | rw-r----- | Group-readable files | Owner can edit; the group can read; others have no access. |
664 | rw-rw-r-- | Shared files | Owner and group can edit; others can read. |
775 | rwxrwxr-x | Shared directories | Owner and group can edit; others can read and traverse. |
777 | rwxrwxrwx | World-writable | Everyone can read, write and execute. Usually too permissive. |
Understand the bits
How Linux permissions work,
bit by bit.
What does chmod do?
chmod means “change mode.” It changes the permission bits on Linux and macOS files and directories: what the owner, the file’s group and everyone else can do. It does not change who owns the file; that is chown, as in sudo chown deploy:www-data /var/www/app, which makes deploy the owner and www-data the group.
How to change file permissions in Linux
Use chmod with the new mode and the file name. Check the current permissions first with ls -l, which shows them as a string like -rw-r--r--, then set the octal value from the calculator above. You need to own the file or use sudo, and the change takes effect at once.
- Run
ls -l deploy.shto see the current mode, for example-rw-r--r--(644). - Run
chmod 755 deploy.shto set the new mode. Addsudoif you do not own the file. - Run
ls -l deploy.shagain and check that it now reads-rwxr-xr-x.
Don’t fix a “Permission denied” error with chmod -R 777. It lets every user on the server change or replace every file in that folder. Set 755 on directories and 644 on files, or fix the owner with chown.
Read = 4, write = 2, execute = 1
Add the values for each group, then read the three digits from owner to group to others. Read and write is 4 + 2 = 6. Read alone is 4. Together, an owner who can read and write and everyone else who can only read gives 644, or rw-r--r--.
Files and directories work differently
On a file, read opens its contents, write changes them and execute allows running it as a program. On a directory, read lists entry names, write allows creating or removing entries when combined with execute, and execute allows traversal and access to entries. An entry’s own permissions still matter.
A writable parent directory can allow a file to be removed even if the file is read-only. Ownership, ACLs and other system controls can affect the final result, so a mode alone cannot explain every “Permission denied” error.
A fourth digit for special permissions
The leading digit combines setuid (4), setgid (2) and sticky (1). Their execute positions appear as s or t, or uppercase S / T when execute is off. Open Advanced options above to inspect these bits.
Numeric modes can preserve existing setuid/setgid bits on directories under GNU chmod. The generated symbolic command explicitly sets or clears special bits. Actual behavior also depends on the operating system and your privileges.
Read the GNU file permission referenceA few useful answers
Chmod, explained.
How do I calculate a chmod value?
Add up the permissions for each of the three groups separately, using read=4, write=2, and execute=1. Do it once for the owner, once for the group, and once for others, then read the three digits left to right. Read, write, and execute is 4+2+1=7; read and execute is 4+1=5; read and write is 4+2=6. So an owner with full access and a group and others that can only read and execute gives 755. The calculator on this page does the arithmetic for you as you tick the boxes.
How do I change file permissions in Linux?
Run chmod with the new mode and the file name, for example chmod 644 index.html. Check the current mode first with ls -l, and add sudo if you do not own the file. The calculator on this page turns the access you want into the right number.
What does chmod 755 mean?
chmod 755 gives the owner full read, write, and execute permission (7), and gives the group and everyone else read and execute but not write (5 and 5). It is the standard setting for directories, scripts, and executables that everyone should be able to run but only the owner should be able to change.
What does chmod 644 mean?
chmod 644 (rw-r--r--) lets the owner read and write the file, and lets the group and everyone else only read it. It is the usual mode for regular files such as web pages, images and most config files. Nobody can run the file as a program, because no one has the execute bit.
What is the difference between 644 and 755?
Both give the owner read and write and grant read access to group and others. The difference is the execute bit: 755 adds execute for everyone (4+1 for group and others), so it is used for directories and runnable scripts, while 644 has no execute bit and is used for regular files like documents, configs, and web pages.
What is 775 permission?
775 (rwxrwxr-x) gives the owner and the group full read, write, and execute permission (7 and 7), and gives everyone else read and execute but not write (5). It is used for shared project directories where every member of a team needs to create, edit, and delete files, while other users on the system can still read and traverse them. The file equivalent, without the execute bit, is 664.
What is chmod 640 used for?
chmod 640 (rw-r-----) lets the owner read and write, the group only read, and everyone else nothing. Use it for a file a service has to read but other users should not see, such as a config file with a database password. Give the file the service’s group, for example sudo chown deploy:www-data app.conf, then run chmod 640 app.conf.
How do I convert rwxr-xr-x to a number?
Split the nine characters into three triads, one each for owner, group, and others, then add up the letters in each triad using r=4, w=2, x=1 and treating a dash as zero. For rwxr-xr-x that is rwx=7, r-x=5, and r-x=5, which gives 755. Paste the symbolic string into the Symbolic box on this page and the octal value appears immediately, including 10-character strings copied out of ls -l.
What permission should I use for SSH private keys?
SSH private keys should be chmod 600 (rw-------) so that only the owner can read or write them, and your ~/.ssh directory should be chmod 700. SSH refuses to use a private key that is readable by the group or others. CtrlOps keeps your key file where it is and saves only its path, so the key never leaves your computer.
What does chmod -R do?
The -R (recursive) flag applies the permission change to a directory and everything inside it - all subdirectories and files. Use it carefully: applying an executable permission recursively to a tree of regular files, or loosening permissions on a whole directory, can have unintended security consequences.
Is chmod 777 safe?
No. chmod 777 grants read, write, and execute to everyone on the system, including the ability for any user to modify or replace the file. It is almost never the right fix for a permissions problem and is a common security risk. Prefer the narrowest permission that works - usually 644 for files or 755 for directories and scripts.
What is the difference between octal and symbolic chmod?
Octal notation uses numbers (chmod 644 file) where each digit is the sum of read=4, write=2, and execute=1 for owner, group, and others. Symbolic notation uses letters (chmod u=rw,go=r file or chmod +x file) to add, remove, or set specific permissions. Octal sets the ordinary permission bits together, while symbolic is handy for changing one permission without touching the rest. Special bits on directories can behave differently, so the two forms are not interchangeable in every case.
Go a little deeper
Guides and documentation to go further.