Octal and number base tools

Move a number between binary, octal, decimal and hex, read Linux file permissions, or turn text into octal codes.

One number, four bases
Binary111101101
Octal755
Decimal493
Hex1ED

As a chmod value, 755 means rwxr-xr-x

Runs in your browser. Nothing you type is uploaded.

Number bases

For a number written in one base that you need in another.

Base converterAny base from 2 to 36255 to base 36 → 73
Octal to decimalBase 8 to base 10755 → 493
Decimal to octalBase 10 to base 8493 → 755
Hex to octalBase 16 to base 8FF → 377

Text and file permissions

For octal codes in text, C strings and Unix permissions.

Text to octalCharacters to base 8 codesHi → 110 151
Chmod calculatorLinux permissions in octal755 → rwxr-xr-x

Common chmod values

Each digit is one group of users: owner, then group, then everyone else. Read is 4, write is 2, execute is 1.

ValueShown by ls -lOwner / group / othersTypical use
644rw-r--r--read and write / read / readOrdinary files, web pages, config files
600rw-------read and write / none / noneA private SSH key
400r--------read / none / noneAn AWS .pem key, which SSH refuses if others can read it
755rwxr-xr-xall / read and run / read and runFolders and scripts others may run
700rwx------all / none / noneThe ~/.ssh folder
775rwxrwxr-xall / all / read and runA folder a team shares
777rwxrwxrwxall / all / allAvoid on a server: any user can change the file

Writing octal in code

The same 755 means different things depending on where you type it.

WhereWrite it asWhat 0755 does there
chmod in a shellchmod 755 fileSame as 755; chmod always reads the digits as octal
C and C++0755Octal, value 493
Python 30o755SyntaxError
JavaScript0o755Error in strict mode and in modules

Where octal still turns up

Octal is base 8 and uses the digits 0 to 7. Each octal digit stands for exactly three bits, which is why it suits Unix file permissions: read, write and execute are three bits, so one digit covers one group of users. In 755 the owner can read, write and execute, and everyone else can read and execute.

Outside chmod, octal mostly appears in older C code, where a number that starts with 0 is read as octal, so 010 means eight. For any other base, the base converter handles everything from base 2 to base 36.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute (7 = 4 + 2 + 1). The group and everyone else can read and execute but not change the file (5 = 4 + 1). ls -l shows it as rwxr-xr-x.

What does chmod 600 do?

It lets the owner read and write the file and shuts everyone else out, rw-------. SSH expects this on private keys and will refuse to use a key that other users can read.

How do I change file permissions in Linux?

Run chmod 644 file.txt with the number you want, or use letters, such as chmod u+x script.sh to let the owner run a script. Check the result with ls -l. Changing a file you do not own needs sudo.

Scroll to Top