Explainer 5 min read

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.

chmod 755 meaningchmod 644chmod 777octal permissions linuxrwx permissions calculator

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:

PermissionLetterValueBinary bit
Readr4100
Writew2010
Executex1001

All eight possible digits:

DigitBinarySymbolicMeaning
0000---No access
1001--xExecute only
2010-w-Write only
3011-wxWrite and execute
4100r--Read only
5101r-xRead and execute
6110rw-Read and write
7111rwxRead, 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

NumberSymbolicOwnerGroupOthersTypical use
755rwxr-xr-xrwxr-xr-xDirectories, scripts and programs others may run
644rw-r--r--rw-r--r--Ordinary files: HTML, images, documents
600rw-------rw-------Private files such as SSH private keys
700rwx------rwx------Private directories or scripts
750rwxr-x---rwxr-x---Shared with the group only
664rw-rw-r--rw-rw-r--Files a team edits together
400r--------r--------Read-only for the owner
777rwxrwxrwxrwxrwxrwxEveryone 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.

  • Open the Number Base Converter.
  • Set From to Octal (Base 8).
  • Type the permission number, for example 755.
  • Set the target to Binary (Base 2). You get 111101101.
  • Split the binary into groups of three from the left: 111 101 101. Each 1 is a permission that is on, in the order r, w, x.
  • More results from the converter:

    OctalBinaryDecimal
    755111 101 101493
    644110 100 100420
    600110 000 000384
    777111 111 111511
    750111 101 000488

    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.sh adds execute for the owner.
    • chmod go-w file.txt removes write for group and others.
    • chmod a+r file.txt adds 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.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool