Free browser converter
Octal to Binary Converter
Map every validated octal digit to exactly three binary bits, preserving leading zeros with compact, grouped, or 0b-prefixed output.
Interactive tool
Convert octal integers to binary bits
Ready
Choose the exact representation you need; the tool does not guess an encoding.
Detailed conversion guide
How to Convert Octal to Binary
Every octal digit maps to three binary bits because eight equals 2^3. Octal 7 becomes 111 and 5 becomes 101, so octal 755 becomes 111101101.
Direct digit mapping preserves every octal position. Grouped output shows the correspondence, compact output joins the groups, and prefixed output adds 0b.
| Input | Output | Meaning |
|---|---|---|
0 | 000 | one digit |
5 | 101 | one digit |
17 | 001 111 | two digits |
755 | 111 101 101 | three digits |
Octal to Binary in JavaScript and Python
Validate every digit from 0 through 7, then map each digit to a three-bit padded string. Direct mapping avoids floating-point limits.
if (!/^[0-7]+$/.test(input)) throw new Error("Invalid octal");
const binary = [...input].map(x => parseInt(x, 8).toString(2).padStart(3, "0")).join("");Three-Bit Width, Prefixes, and Invalid Octal
Leading octal zeros are preserved as 000 groups. That is useful for masks, permission fields, protocol values, and test vectors.
Digits 8 and 9, signs, fractions, and prose are invalid. A 0o input prefix is accepted, while 0b is available only as output.
Related converters
Continue converting ASCII and Unicode
Choose the converter for the direction and representation you need.