Chmod calculator
Tick the permissions you want, or type a number like 755, to get the chmod command.
This free chmod permissions calculator works in your browser. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.
How the numbers work
Each digit is the sum of read (4), write (2) and execute (1) for one group of people: the file’s owner, its group, then everyone else. 7 is 4+2+1 (everything), 5 is 4+1 (read and execute), 6 is 4+2 (read and write).
| Mode | Symbolic | Typical use |
|---|---|---|
| 644 | -rw-r--r-- | Ordinary files and web pages |
| 755 | -rwxr-xr-x | Folders and scripts |
| 600 | -rw------- | Private files such as SSH keys |
| 700 | -rwx------ | Private folders |
| 775 | -rwxrwxr-x | Shared project folders |
| 1777 | drwxrwxrwt | Shared temporary folders like /tmp |
Special bits
- Set user ID (4000): a program runs with its owner’s rights.
passwduses this. - Set group ID (2000): on a folder, new files inherit the folder’s group.
- Sticky bit (1000): in a shared folder, only a file’s owner can delete it.
A warning about 777
777 lets anyone on the system change or replace the file. On a web server that is a common way sites get hacked. If something only works with 777, fix the owner with chown instead.
Worked example: Comparing 755, 644, and 4755 octal bitmasks
Each digit of a chmod number is the sum of Read (4), Write (2), and Execute (1) for Owner (user), Group, and Others:
- Web directory or executable script (
chmod 755 deploy.sh):- Owner =
4 + 2 + 1 = 7(rwx: read, write, execute). - Group =
4 + 0 + 1 = 5(r-x: read and execute, no write). - Others =
4 + 0 + 1 = 5(r-x: read and execute, no write). - Symbolic string:
-rwxr-xr-x(ordrwxr-xr-xfor a directory).
- Owner =
- Static HTML/config file (
chmod 644 index.html): Owner4 + 2 = 6(rw-), Group4(r--), Others4(r--) →-rw-r--r--. - Private SSH key (
chmod 600 id_ed25519): Owner6(rw-), Group0(---), Others0(---) →-rw-------(OpenSSH refuses to use a key if Group or Others have any permissions).
Limits and what this tool cannot do
- Traditional POSIX mode bits only (not POSIX ACLs or SELinux):
chmodsets the 12 standard POSIX mode bits (9rwxbits + 3 special bitssetuid,setgid,sticky). It does not generate fine-grained Access Control Lists (setfacl -m u:alice:rx) or SELinux security contexts (chcon). - Directories require Execute (
x) to enter: On Linux and macOS, giving a folder Read (4) without Execute (1)—such aschmod 644 folder—prevents non-owners fromcd-ing into the directory or reading file inodes inside it; folders almost always need755or750. - Windows NTFS drives ignore POSIX chmod bits: Running
chmodon a FAT32/exFAT thumb drive or native Windows NTFS partition without WSL metadata has little or no effect.
Questions
What does chmod 755 mean?
The owner can read, write and execute; the group and everyone else can read and execute.
Should website files be 644 or 755?
Files 644 and folders 755 on most hosts. Configuration files with passwords should be 600 or 640.
What does the first character mean?
In ls -l output it is the file type: - for a file, d for a folder, l for a link.
Why does OpenSSH reject my private key unless I run chmod 600 or chmod 400?
If group or world permissions are non-zero (for example 0644), any other local user account on that machine could read your private SSH key file. OpenSSH enforces 0600 (-rw-------) or 0400 (-r--------) as a mandatory security check.
What does the sticky bit (1777) on /tmp actually do?
Normally, if a directory is world-writable (777), any user can delete any other user's files inside that directory. Setting the sticky bit (chmod 1777 /tmp, shown as drwxrwxrwt) allows everyone to create files in /tmp, but only the file's owner (or root) can delete or rename their own files.
How do I apply chmod 755 to directories and 644 to files recursively?
Avoid running chmod -R 755 on a web folder because that marks every image and HTML file as an executable script. Instead run find . -type d -exec chmod 755 {} + for directories and find . -type f -exec chmod 644 {} + for files.