Skip to content
ZeroServer.tools

Binary to Octal Converter

Convert binary (base 2) numbers to octal (base 8).

Octal
Output updated — 18 characters

Binary to octal conversion explained

Binary (base 2) uses only the digits 0 and 1. Octal (base 8) uses digits 0–7. The easiest manual shortcut is to group binary digits into threes from the right and map each triplet to an octal digit — 111 111 becomes 77, and 001 000 000 becomes 100. This tool handles arbitrarily large integers entirely in your browser using BigInt arithmetic. To go the other way, try the Octal to Binary Converter, or use the all-in-one Base Converter for any radix from 2 to 36.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Turning a bit pattern into the octal form a permission or a legacy field expects.
  • Grouping bits in threes to read them as octal digits.
  • Converting a computed mask into an octal chmod value.
  • Reading a binary field against documentation written in octal.
  • Working through a base-conversion exercise where the grouping is the lesson.

Frequently Asked Questions

Why group binary digits in threes rather than fours?
Because 8 = 2³, so one octal digit is exactly three bits and no carry ever crosses a group boundary. Hex groups in fours for the same reason, 16 = 2⁴. That is why 111111 splits as 111|111 to give 77, and why this conversion needs regrouping from the right rather than arithmetic.
How large a number can it convert?
Any size. Each line is accumulated with BigInt rather than a JavaScript number, so a 300-digit binary string converts exactly. A double would have started losing precision above 2⁵³ − 1, which is only 53 binary digits — shorter than a single line of most hex dumps.
Why did my leading zeros disappear?
0001111 and 1111 are the same integer, and the output is that integer re-printed in base 8, so both give 17. If the zeros are significant — a fixed-width register, a permission mask — pad the octal result back out yourself, because the value itself does not carry the width.
Can it handle a binary point like 101.101?
No. Each line must match [01]+, so a fractional value is reported as not-a-binary-number instead of being silently truncated at the point. Three-bit grouping does work after a radix point in principle, but this converter is integer-only.
What happens to a bad line in a large paste?
Only that line fails. Lines are converted independently and an invalid one is replaced in place with a warning naming the offending text, so a single typo in a 500-line batch still leaves you the other 499 conversions rather than one global error.

Common errors and gotchas

  • Grouping from the wrong end. Octal digits take three bits from the least significant, so padding goes at the front.
  • Failing to pad to a multiple of three bits, which shifts every digit.
  • Assuming octal groups align with bytes, when three does not divide eight.
  • Losing the leading zero convention that marks a value as octal in the target.
  • Reading the groups left to right when the padding was added on the right, which changes the value rather than its width.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate