How to use the Chmod Calculator
- 1
Tick or type
Use the read/write/execute grid, type an octal value like
640, or paste a symbolic string such asrw-r-----. - 2
Add special bits if needed
setuid, setgid and sticky become a fourth leading digit, e.g.
2775. - 3
Enter your file name
The command box updates to
chmod 640 yourfileplus an equivalent symbolic command. - 4
Read the explanation
A plain-English line lists what owner, group and others can do, and warns if anyone can write.
Features
Visual grid
Nine checkboxes for read (4), write (2) and execute (1) per class.
Octal in, octal out
Accepts 3- or 4-digit values and fills the grid from them.
ls -l strings
Paste 9 characters or the full 10 from ls -l — the leading file-type character is skipped.
Special bits
setuid, setgid and sticky with correct lowercase/uppercase display.
Copy command
Two equivalent chmod commands ready to paste.
World-writable warning
Flags any value that lets others modify the file.
Who uses it — and for what
Web hosting
Set safe permissions for PHP sites, uploads folders and config files.
SSH and keys
Lock down private keys and the ~/.ssh folder.
Deploy scripts
Make shell scripts executable without opening them to everyone.
Linux learners
Understand what ls -l output actually means.
How Unix permissions work
Every file has permissions for three classes: the owner, the file’s group, and others. Each class can have read (4), write (2) and execute (1); adding them gives one digit per class, so 755 means owner 7 (rwx), group 5 (r-x), others 5 (r-x). On directories, “execute” means permission to enter the directory and access files inside it. An optional leading digit sets special bits: setuid (4), setgid (2) and the sticky bit (1), shown as s/S and t/T in symbolic form.
Common values
| Octal | Use |
|---|---|
| 644 | Normal files — owner can edit, everyone can read (web pages, images) |
| 755 | Directories and scripts/programs |
| 600 | Private files such as SSH keys and .env |
| 700 | Private directories, e.g. ~/.ssh |
| 775 / 664 | Shared group projects |
| 1777 | Shared temp directories like /tmp (sticky) |
Avoid 777 — it lets anyone on the system modify the file, a common cause of hacked websites.
Reading an ls -l line
ls -l prints something like -rwxr-x--- 1 deploy www-data 2048 Nov 28 10:30 backup.sh. The first character is the file type (- regular file, d directory, l symbolic link). The next nine are three groups of three: owner, group, others. Then come the link count, owner name, group name, size, date and file name.
So rwxr-x--- means the owner deploy can read, write and run the script, members of www-data can read and run it, and everyone else can do nothing — octal 750. Paste the whole ten-character string into the symbolic box and the tool drops the leading type character for you. A trailing + or . (ACL or SELinux markers on some systems) is not part of the mode, so remove it before pasting.
Files and folders behave differently
| Permission | On a file | On a directory |
|---|---|---|
| r (4) | Read the contents | List the names inside |
| w (2) | Change the contents | Create, delete or rename entries inside (with x) |
| x (1) | Run it as a program | Enter it and reach files inside by name |
| setuid (4000) | Runs with the file owner’s privileges | Ignored on most systems |
| setgid (2000) | Runs with the file’s group | New entries inherit the directory’s group |
| sticky (1000) | No effect on modern Linux | Only owners can delete or rename their own files |
A surprising consequence: deleting a file depends on write permission on its folder, not on the file. And a folder with r but no x lets you see file names but not open them.
Recursive changes without breaking things
chmod -R 755 site/ sets every file executable too, which is untidy and sometimes unsafe. To give folders 755 and files 644 in one go, use find:
find site/ -type d -exec chmod 755 {} +
find site/ -type f -exec chmod 644 {} +Alternatively, symbolic mode with a capital X adds execute only to directories and files that are already executable: chmod -R u=rwX,go=rX site/. The calculator’s symbolic command uses lowercase letters only, so add capital X yourself when you need it.
Remember that permissions are only half the picture. Ownership (chown user:group) decides who counts as “owner” and “group”, and the default for new files comes from your umask: with the common umask 022, new files start as 644 and new folders as 755.
Worked examples
A config file the web server group can read
Type 640. Symbolic shows rw-r-----, the explanation reads “Owner: read, write · Group: read · Others: no access”, and the command box shows chmod 640 script.sh followed by chmod u=rw,g=r,o= script.sh. An empty o= removes every permission from others.
A shared team folder with setgid
Type 2775. Symbolic becomes rwxrwsr-x: the s in the group execute slot means setgid is on and group execute is set. New files created inside inherit the folder’s group, so teammates can keep working on each other’s files.
Spotting a broken special bit
Type 4644. Symbolic shows rwSr--r-- with a capital S: setuid is set but the owner has no execute permission, so it has no useful effect. A capital T in the last slot means the same for the sticky bit.
Pro tips
- Your private SSH key needs 600 or 400 and ~/.ssh needs 700, or OpenSSH may refuse to use them.
- If a PHP site needs 777 to work, the real fix is usually the file owner — chown it to the web server user instead.
- Use the symbolic form (u+x) to change one bit without touching the rest:
chmod u+x deploy.sh.
Glossary
- Octal
- Base-8 notation; each digit 0–7 encodes one rwx triple.
- umask
- A mask subtracted from default permissions when new files are created.
- setgid
- A bit that makes new files in a directory inherit its group, or runs a program with the file’s group.
- Sticky bit
- On a directory, stops users deleting files they do not own (as in /tmp).
Frequently asked questions
What does chmod 755 mean?
Owner can read, write and execute; group and others can read and execute.
What permissions should website files have?
Usually 644 for files and 755 for folders; never 777.
What permissions does an SSH private key need?
600 (or 400) — SSH refuses keys readable by others.
What is the difference between chmod 755 and chmod u=rwx,g=rx,o=rx?
Nothing in result — both set the same permissions. The calculator shows both forms side by side.
Why does my symbolic input do nothing?
It must be exactly 9 characters (or 10 with a leading type character) using r, w, x, s, S, t, T and dashes in the right positions.
Does chmod work on Windows?
Not on normal Windows folders, which use ACLs instead. It works inside WSL on Linux file systems and on any Linux or macOS server.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)