Quick answer
Each chmod digit is the sum of one class's permissions: read = 4, write = 2, execute = 1. The first digit is the owner, the second the group and the third everyone else. So 755 = rwxr-xr-x (owner has full access, others can read and execute) and 644 = rw-r--r-- (owner reads and writes, others only read).
What is chmod?
Tick read, write and execute for owner, group and others to see the chmod number (755, 644, 0640) and the rwxr-xr-x string that ls -l shows, or type / paste either form to convert it back. The calculator covers the setuid, setgid and sticky bits, explains what each permission means on a file versus a folder (they differ a lot), lets you try symbolic commands such as u+x or go-w, warns about risky modes like 777, and includes common hosting presets for aaPanel or cPanel with chmod commands to copy.

How to calculate chmod permissions
- 1
Tick Read, Write and Execute in the Owner, Group and Others rows; the number and the rwx string update instantly.
- 2
Or type a number (755) or paste an ls -l string (-rw-r--r--) into the matching box to see the grid and the meaning.
- 3
Pick a preset such as “644 · web files” or “600 · wp-config.php, .env” when you are configuring a website.
- 4
Enter the file name under “Commands” and copy the chmod command to run on your server (over SSH or a hosting terminal).
What each digit means
| Digit | Symbolic | Permissions |
|---|---|---|
| 0 | --- | No access |
| 1 | --x | Execute only |
| 2 | -w- | Write only |
| 3 | -wx | Write and execute |
| 4 | r-- | Read only |
| 5 | r-x | Read and execute |
| 6 | rw- | Read and write |
| 7 | rwx | Read, write and execute |
Recommended website permissions (WordPress, Laravel, PHP)
| What | Mode | Notes |
|---|---|---|
| All folders | 755 (or 750) | The web server needs x to enter a folder and r to list it |
| All .php, .html, .css files and images | 644 (or 640) | The owner can edit, the web server can read |
| wp-config.php, .env | 600, 440 or 400 | Holds database passwords; the fewer readers the better |
| uploads, cache, storage folders | 755, owned by the PHP user | Fix the owner (chown) instead of opening 777 |
| ~/.ssh and private keys | 700 for the folder, 600 for keys | SSH refuses keys with looser permissions |
Based on WordPress's security guide (developer.wordpress.org, Hardening WordPress): folders 755 or 750, files 644 or 640, wp-config.php 440 or 400.
r, w and x on files vs folders
| Permission | On a file | On a folder |
|---|---|---|
| r (read) | View the contents | List the names inside (ls) |
| w (write) | Change or overwrite the contents | Create, delete and rename entries (needs x too) |
| x (execute) | Run it as a program or script | Enter the folder (cd) and open files inside by name |
Real-world examples
WordPress cannot write files
This is usually the wrong owner, not missing permissions. Check with ls -l: wp-content should belong to the user PHP runs as, with mode 755. 777 is not needed.
Protecting wp-config.php
Pick the “600 · wp-config.php, .env” preset, enter the file name and copy chmod 600 wp-config.php. Only the owner can read and write it; if PHP runs as another user, use 640 with the right group.
A backup script will not run
“Permission denied” when running ./backup.sh means it lacks execute permission. Try u+x in the symbolic box: 644 becomes 744, then run chmod u+x backup.sh.
A shared team folder
The 2775 preset (setgid) makes every file created in the folder belong to the folder's group, so team members can edit each other's files.
Common mistakes
- Setting 777 on the whole site to fix permission errors.
- 777 lets every process on the machine write there, a classic route for malware. Fix the owner with chown so it matches the PHP user, and keep 755 / 644.
- chmod -R 644 makes the site go blank.
- -R also applies to folders, which lose x so nobody can enter them. Set them separately: find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} +.
- SSH says “UNPROTECTED PRIVATE KEY FILE”.
- Private keys must be 600 (or 400) and ~/.ssh must be 700; SSH rejects keys that other users can read.
- setuid on a PHP or bash script does nothing.
- Linux ignores setuid on scripts for safety. If you need elevated rights, use sudo with a narrow rule.
The fourth digit (setuid, setgid, sticky)
When a mode has four digits, such as 2775 or 1777, the first one holds the special bits: 4 = setuid, 2 = setgid, 1 = sticky. ls -l shows them as s or t in place of x; a capital S or T means the special bit is set without execute permission, which is usually a mistake.
A leading zero as in 0644 is just octal notation in many languages (PHP chmod('a.txt', 0644)); for the chmod command, 0644 and 644 are the same.
Glossary
- chmod
- The Linux / Unix command that changes a file's or folder's access mode.
- chown
- The command that changes a file's owner and group, e.g. chown www-data:www-data index.php.
- Owner (u)
- The user who owns the file, usually whoever created it.
- Group (g)
- The user group assigned to the file; its members get the second digit's permissions.
- Others (o)
- Every other user on the machine, including the web server process if it is neither owner nor in the group.
- umask
- A mask that removes permissions from new files; umask 022 gives files 644 and folders 755.
Frequently asked questions
What does chmod 755 mean?
The owner can read, write and execute (7); the group and others can read and execute (5). It is the standard mode for website folders and scripts that need to run.
What does chmod 644 mean?
The owner can read and write (6); the group and others can only read (4). It is the standard mode for HTML, PHP and image files on a website.
Should I ever use chmod 777?
Almost never on a web server. Fix “cannot write” errors with chown to the right user, or 775 if a group needs to write too.
How do I see a file's current permissions?
Run ls -l filename to see -rw-r--r--, or stat -c '%a %n' filename to see 644. Hosting file managers usually show a Permissions column.
How do I change permissions recursively?
chmod -R applies one mode to everything and easily strips x from folders. Use find to set folders (755) and files (644) separately, as in the commands in the tool.
Does Windows have chmod?
Windows uses its own ACLs; chmod only means something on Linux, macOS or inside WSL. The permissions shown in FileZilla or a hosting file manager are chmod on the server.
Ratings and comments
Loading…