Octal to binary converter
Convert octal numbers to binary — every octal digit becomes 3 bits. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.
Part of developer tools.
Binary
10101101
Octal
255
Decimal
173
Hexadecimal
AD
Octal to binary table
| Decimal | Octal | Binary |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 2 | 10 |
| 3 | 3 | 11 |
| 4 | 4 | 100 |
| 5 | 5 | 101 |
| 6 | 6 | 110 |
| 7 | 7 | 111 |
| 8 | 10 | 1000 |
| 9 | 11 | 1001 |
| 10 | 12 | 1010 |
| 11 | 13 | 1011 |
| 12 | 14 | 1100 |
| 13 | 15 | 1101 |
| 14 | 16 | 1110 |
| 15 | 17 | 1111 |
| 16 | 20 | 10000 |
| 100 | 144 | 1100100 |
| 127 | 177 | 1111111 |
| 255 | 377 | 11111111 |
| 256 | 400 | 100000000 |
| 1000 | 1750 | 1111101000 |
| 1024 | 2000 | 10000000000 |
| 4096 | 10000 | 1000000000000 |
| 65535 | 177777 | 1111111111111111 |
| 4294967295 | 37777777777 | 11111111111111111111111111111111 |
| 18446744073709551615 | 1777777777777777777777 | 1111111111111111111111111111111111111111111111111111111111111111 |
The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.
How to convert octal to binary
Replace each octal digit with its 3-bit binary value, keeping the leading zeros inside each group — octal 1 is 001, not 1 — and join the groups in order. For 255: 2 → 010, 5 → 101, 5 → 101, giving 010 101 101, which is 10101101 once the leading zeros are dropped. Nothing is carried from one digit to the next, so a long octal number converts as easily as a short one.
Octal and binary side by side
The largest 16-bit value is 177777 in octal and 1111111111111111 in binary: 6 digits against 16. Every octal digit is exactly 3 bits, so the lengths stay in a fixed ratio and any stretch of digits can be converted without looking at its neighbours. Binary is what bit masks, flags and subnet masks are reasoned in: a /24 network mask is twenty-four 1 bits followed by eight 0 bits, 255.255.255.0 once written in decimal. In JavaScript and Python source, 173 is written 0o255 in octal and 0b10101101 in binary. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — octal on this page.
Other conversions
Going the other way? Binary to octal converter.
Or open the full number base converter and see a number in all four bases at once.