TOP

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.

No signupFree online conversion

Interactive tool

Convert octal integers to binary bits

Ready

Mode and output format

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.

InputOutputMeaning
0000one digit
5101one digit
17001 111two digits
755111 101 101three 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

Choose the converter for the direction and representation you need.

Advertisement

Sponsored link