chmod 755, 644 and 777 Explained: Octal File Permissions
What chmod 755, 644, 600 and 777 mean, how each octal digit maps to read, write and execute bits, and how to check any permission number with a base converter.
The short answer
A chmod number like 755 is three octal digits, one each for the owner, the group and others. Each digit adds up read = 4, write = 2 and execute = 1. So 755 means owner rwx (4+2+1), group r-x (4+1), others r-x, and 644 means owner rw- (4+2), group r--, others r--. Converting the octal number to binary shows the nine permission bits directly: in the free Number Base Converter, octal 755 becomes binary 111101101.
How each digit is built
Every permission digit is a sum of three values:
| Permission | Letter | Value | Binary bit |
|---|---|---|---|
| Read | r | 4 | 100 |
| Write | w | 2 | 010 |
| Execute | x | 1 | 001 |
All eight possible digits:
| Digit | Binary | Symbolic | Meaning |
|---|---|---|---|
| 0 | 000 | --- | No access |
| 1 | 001 | --x | Execute only |
| 2 | 010 | -w- | Write only |
| 3 | 011 | -wx | Write and execute |
| 4 | 100 | r-- | Read only |
| 5 | 101 | r-x | Read and execute |
| 6 | 110 | rw- | Read and write |
| 7 | 111 | rwx | Read, write and execute |
Because each digit is exactly three bits, octal (base 8) is a natural fit: one octal digit always maps to one group of three permission bits.
Common chmod values
| Number | Symbolic | Owner | Group | Others | Typical use |
|---|---|---|---|---|---|
| 755 | rwxr-xr-x | rwx | r-x | r-x | Directories, scripts and programs others may run |
| 644 | rw-r--r-- | rw- | r-- | r-- | Ordinary files: HTML, images, documents |
| 600 | rw------- | rw- | --- | --- | Private files such as SSH private keys |
| 700 | rwx------ | rwx | --- | --- | Private directories or scripts |
| 750 | rwxr-x--- | rwx | r-x | --- | Shared with the group only |
| 664 | rw-rw-r-- | rw- | rw- | r-- | Files a team edits together |
| 400 | r-------- | r-- | --- | --- | Read-only for the owner |
| 777 | rwxrwxrwx | rwx | rwx | rwx | Everyone can do everything; avoid |
Check any number with the base converter
Converting octal to binary is a quick way to see exactly which bits are on.
More results from the converter:
| Octal | Binary | Decimal |
|---|---|---|
| 755 | 111 101 101 | 493 |
| 644 | 110 100 100 | 420 |
| 600 | 110 000 000 | 384 |
| 777 | 111 111 111 | 511 |
| 750 | 111 101 000 | 488 |
The decimal value is what the operating system stores internally. You rarely need it, but it explains why some programming languages print 493 when you expect 755: they show the number in base 10. In code, write octal literals with the prefix your language uses, such as 0o755 in Python and modern JavaScript.
If the binary output is shorter than nine digits, the leading groups are zeros. For example, octal 7 converts to 111, which is really 000 000 111.
Directories: what execute means
For a file, execute means it can be run as a program. For a directory, the bits mean something slightly different:
- r (read): list the names of files in it.
- w (write): create, delete or rename files in it. This usually needs x as well.
- x (execute): enter the directory and access files inside it by name.
That's why directories are usually 755 or 750, not 644. A directory with 644 can't be entered, even by users who can list its contents.
Using chmod
Numeric form:
chmod 644 index.html
chmod 755 deploy.sh
chmod -R 755 public/ applies to a folder and everything in it. Be careful: this also makes every file executable. A common approach is to set directories and files separately with find, for example find public -type d -exec chmod 755 {} + and find public -type f -exec chmod 644 {} +.
Symbolic form, if you prefer letters:
chmod u+x script.shadds execute for the owner.chmod go-w file.txtremoves write for group and others.chmod a+r file.txtadds read for everyone.
To see current permissions, run ls -l. The first column, such as -rw-r--r--, shows the type (- for a file, d for a directory) followed by the nine permission letters.
The fourth digit
You will sometimes see four digits, such as 2755 or 1777. The extra leading digit sets special bits:
- 4 = setuid
- 2 = setgid
- 1 = sticky bit (on shared directories like /tmp, users can only delete their own files)
With three digits, the special bits are left unchanged or zero, depending on the system. Use them only when you know you need them.
Why 777 is a bad fix
When a web app can't write to a folder, it is tempting to run chmod 777. It usually "works" because now anyone can write there, which is exactly the problem. On a shared server, any user or compromised process could replace your files. A safer fix is to give ownership of the folder to the user the web server runs as, then use 755 for directories and 644 for files, or 775 and 664 for a shared group.
Common mistakes
- Using 644 on a directory. It can't be entered. Use 755.
- Making SSH keys readable by others. SSH clients commonly refuse private keys with loose permissions. Use 600.
- Reading the digits in the wrong order. It is always owner, group, others.
- Typing 0755 into a converter that treats it as decimal. Set the input to octal first.
For converting between number systems by hand, see how to convert decimal to binary by hand.
Frequently asked questions
What does chmod 755 mean?
The owner can read, write and execute (7 = rwx), and the group and everyone else can read and execute but not write (5 = r-x). In symbolic form it is rwxr-xr-x.
What does chmod 644 mean?
The owner can read and write (6 = rw-), and the group and others can only read (4 = r--). It is the usual permission for ordinary files such as web pages and images.
Why is chmod 777 dangerous?
It lets every user on the system read, write and execute the file or directory. Anyone who can reach the system as any user can change or replace it.
How do the numbers in chmod work?
Each digit is an octal number made of three bits: read = 4, write = 2 and execute = 1. Add the ones you want. 4 + 2 + 1 = 7, 4 + 1 = 5, 4 + 2 = 6.
Put this guide into practice with our free online tool — no signup required.
Open tool