Octal to binary converter
Type octal to get binary. Each octal digit becomes three bits.
Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.
How to convert octal to binary
Replace each octal digit with its three-bit pattern and join them: 6 is 110, 4 is 100 and 4 is 100, so 644 is 110 100 100. Leading zeros at the very front can be dropped.
Octal to binary chart
| Octal | Binary | Decimal |
|---|---|---|
| 0 | 000 | 0 |
| 1 | 001 | 1 |
| 2 | 010 | 2 |
| 3 | 011 | 3 |
| 4 | 100 | 4 |
| 5 | 101 | 5 |
| 6 | 110 | 6 |
| 7 | 111 | 7 |
Common mistakes
Dropping zeros inside a digit
Writing 5 0 1 as 101 0 1 instead of 101 000 001
Instead: Write every digit as exactly three bits, zeros included
Short groups
Writing 1 as 1 instead of 001 in the middle of a number
Instead: Only the leading zeros of the whole number can be dropped
Treating 0o as digits
Reading the 0o prefix as part of the number
Instead: 0o only marks the number as octal; it isn’t a digit
Octal in code
JavaScript writes octal numbers with a 0o prefix, as in 0o755, alongside 0b for binary and 0x for hex (ECMA-262, section 12.9.3). The converter accepts all three prefixes.
Sources and method
- ECMA-262, ECMAScript Language Specification, section 12.9.3 Numeric Literals: the 0b, 0o and 0x prefixes for binary, octal and hex. Checked 2026-11-25.
Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.
Questions
Can a digit be 8 or 9?
No. Octal only has 0 to 7, so the converter flags an 8 or 9 and offers to read the number as decimal instead.
How do I go from octal to hex?
Go through binary: write each octal digit as three bits, then regroup the bits in fours. The base converter does it in one step.