Tools
Log in
English

All converters

Octal converter

Convert octal to decimal, binary and hex and back. Handy for modes like 755.

Result

Decimal
Hex
Binary
Octal

Settings

Octal uses only the digits 0 to 7, and each place is worth 8 times the one to its right. Enter an octal value such as 755 or 0o17 to see it in decimal, binary and hex together, or switch the input base to go the other way. Free and quick, right in the page.

How to do it by hand

  1. Octal to decimal: multiply the digits by 1, 8, 64, 512 and so on from the right, then add.
  2. Octal to binary: write every digit as three bits, from 000 for 0 to 111 for 7.
  3. Decimal to octal: divide by 8 until you reach 0 and read the remainders from the bottom.
  4. File modes: each digit is read (4) plus write (2) plus run (1) for one group of users.

Worked examples

755 (octal)

7×64 + 5×8 + 5×1 = 448 + 40 + 5

493

17 (octal)

1×8 + 7×1

15

100 (decimal)

100 ÷ 8 = 12 r 4, 12 ÷ 8 = 1 r 4, 1 ÷ 8 = 0 r 1

144

Common mistakes

  • Typing 8 or 9 into an octal value. Those digits do not exist in base 8, and the tool points at the spot.
  • Forgetting that a leading 0 meant octal in older code. In old C and JavaScript, 010 can mean 8.
  • Passing 644 to a script as a decimal number. chmod expects octal, and decimal 644 is a different mode.

One octal digit and file permissions

OctalBinary (3 bits)rwxMeaning
0000---nothing
1001--xexecute
2010-w-write
3011-wxwrite, execute
4100r--read
5101r-xread, execute
6110rw-read, write
7111rwxeverything

Questions people ask

What does 755 mean for a file?

Owner 7 (read, write, run), group 5 (read, run) and everyone else 5 (read, run).

Is octal still used?

Mostly for Unix file permissions and a few older formats. Hex has taken over most other jobs.

How do I mark a value as octal?

Start it with 0o, like 0o755, or pick base 8 as the input base.