chmod 755 vs 644: which permission should you use?
When to use chmod 755 versus 644—what each octal mode grants, why directories need the execute bit and how to pick safe defaults for files and folders.
Quick Answer
Use chmod 644 for ordinary files so the owner can edit them while everyone else only reads. Use chmod 755 for directories and executable scripts because both need the execute bit to be entered or run. The difference is a single execute bit per class.
Search Snapshot
- Format
- Engineering
- Reading time
- 4 min
- Last updated
- June 12, 2026
- Primary topic
- chmod 755 vs 644
- Intent
- informational
Key Takeaways
Point 1
644 means owner read-write, everyone else read only—the right default for regular files.
Point 2
755 adds execute for all three classes—the right default for directories and scripts.
Point 3
Directories need the execute bit or their contents become unreachable even when readable.
If you have ever run chmod you have almost certainly typed 755 or 644 and you may have copied them from a forum post without knowing why. The chmod 755 vs 644 question comes up constantly because these two modes cover the large majority of everyday cases. The difference between them is a single permission bit, but getting it wrong either breaks access or quietly over-shares a file.
What the digits mean
Each digit in an octal mode is the sum of three permission bits for one class of user: read is 4, write is 2 and execute is 1. The three digits map to the owner, the group then everyone else. So 644 reads as owner 6 (read plus write), group 4 (read) and other 4 (read). 755 reads as owner 7 (read plus write plus execute), group 5 (read plus execute) and other 5 (read plus execute). The only thing that changed is the execute bit.
| Mode | Owner | Group | Other | Typical use |
|---|---|---|---|---|
| 644 | read/write | read | read | Regular files, web assets, configs |
| 755 | read/write/execute | read/execute | read/execute | Directories and executable scripts |
| 600 | read/write | none | none | Private files such as SSH keys |
| 700 | read/write/execute | none | none | Private directories |
The modes you reach for most, by what they grant.
Why directories are different
The execute bit means two different things depending on what it is attached to. On a regular file it controls whether the file can be run as a program. On a directory it controls whether you can enter the folder and reach the files inside. This is the detail that trips people up: a directory set to 644 is readable in name but unusable in practice because nobody can traverse into it. That is why folders are almost always 755 or 700, while plain files sit at 644 or 600. You can see this interplay clearly in the chmod calculator by toggling the execute column on a folder and a file.
Picking a default
For content that should be world-readable but only owner-writable—source files, images, static site output—644 is correct. For anything that must be executed or entered—shell scripts, binaries, every directory—755 is correct. When a file is private, drop the group and other bits entirely and use 600 or 700. Reach for looser group-write modes like 664 or 775 only when a shared group genuinely needs to write and treat 777 as a warning sign rather than a fix, because it lets any user on the system modify the file.
Setting them in practice
Setting a single file is one command: chmod 644 style.css. Setting a whole tree is where people get into trouble, because applying 755 to every file marks documents as executable while applying 644 to everything locks your directories. The fix is to treat files and folders separately, which is covered in chmod -R: changing permissions recursively. If you prefer expressing changes as letters rather than numbers, octal vs symbolic chmod notation explains the u+x style and when it is clearer.
Frequently asked questions
What is the difference between chmod 755 and 644?
755 grants execute to all three classes on top of read, while 644 grants no execute. That single bit is why 755 suits directories and scripts while 644 suits files that only need reading.
Should I use 644 or 755 for a directory?
Use 755. A directory needs the execute bit so you can enter it and reach its contents, so 644 on a folder effectively locks everyone out.
Bottom line
The chmod 755 vs 644 choice comes down to one question: does this thing need to be executed or entered? If yes, use 755. If it only needs to be read, use 644. Build the mode visually in the chmod calculator whenever you are unsure and you will never copy a random number from a forum again.
Get new playbooks weekly
Actionable guides, market updates and shipping notes — once a week.