Skip to content

Binary to Octal Converter

Convert binary numbers to octal (base 8) instantly using 3-bit grouping. Every three binary digits map to a single octal digit.

Binary Group to Octal Digit

0000
0011
0102
0113
1004
1015
1106
1117

How to Convert Binary to Octal

Because 8 = 2³, each octal digit is exactly three binary digits. This lets you convert without any division:

  1. Start from the right of the binary number
  2. Split the digits into groups of three
  3. Pad the leftmost group with leading zeros if it has fewer than three bits
  4. Convert each 3-bit group to its octal digit (000=0 to 111=7)

Example: Convert 11010 to octal:

  • Group from the right: 11 010 → pad to 011 010
  • 011 = 3, 010 = 2
  • Result: 32 (octal)

Code Examples

const binary = "11010";
parseInt(binary, 2).toString(8); // "32"

Frequently Asked Questions

How do I convert binary to octal?

Group the binary digits into sets of three from the right, padding the leftmost group with zeros if needed, then map each group to one octal digit (000=0 up to 111=7). For example, 11010 becomes 011 010 = 32.

Why groups of three bits?

Because 8 = 2³, each octal digit corresponds to exactly three binary digits. This makes binary-to-octal a direct lookup with no division or multiplication required.

Does it accept a 0b prefix?

Yes. You can enter plain binary like 101010 or prefixed binary like 0b101010. Only the digits 0 and 1 are valid input.

Related Tools