plain/devtools home

chmod 755 vs 644

Use 755 for directories and scripts that must run, and 644 for ordinary files. Both let the owner write and everyone else only read; 755 adds the execute bit, which a directory needs before anyone can enter it.

Last reviewed 2026-11-04.

chmod-calculatorsamplesCtrl↵ run · s sample
WhoReadWriteExecuteSpecial
Owner (u)
Group (g)
Others (o)

never leaves your browser

The two modes side by side

ModeSymbolicWho can do what
755rwxr-xr-xOwner: read, write, execute; Group: read, execute; Others: read, execute
644rw-r--r--Owner: read, write; Group: read; Others: read

Worked example

A web project has a deploy.sh script, HTML files and folders. Give the script and folders 755 and the files 644:

$ chmod 755 deploy.sh
find public -type d -exec chmod 755 {} +
find public -type f -exec chmod 644 {} +

Why directories need the execute bit

On a directory, x means permission to enter it and reach the files inside. A directory at 644 can be listed by its owner at best but not entered, so files in it fail to open. That is why directories are 755 and plain files are 644. A file only needs x if you run it as a program.

Common mistakes

  • Running chmod -R 755 . and making every data file executable. Use the two find commands above instead.
  • Using 777 to fix a permission error. Find the real cause; see what chmod 777 means.
  • Forgetting that the web server user, not you, reads the files. Others need r on files and x on every parent directory.

Running this on a server

These modes matter most on a server you manage yourself. A small VPS gives you the shell to set them; static hosts handle permissions for you. See the hosting guide.

Frequently asked questions

Is 644 or 755 better for a PHP or HTML file?

644. The web server only needs to read the file. Use 755 on directories.

What is the difference in symbols?

755 is rwxr-xr-x and 644 is rw-r--r--. The only difference is the execute bit on each of the three classes.

How do I apply them to a whole tree?

Use find with -type d for directories and -type f for files, as in the worked example. A single chmod -R sets one mode for both.

Sources

Related

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc