Binary to Octal

Turn binary words into octal, one value per line, with an optional reference table.

Binary
Octal
Runs locally in your browser

About the Binary to Octal

Octal packs exactly three binary digits into one symbol, which makes the conversion a purely mechanical regrouping. Pad the binary string on the left until its length is a multiple of three, split it into triples, and replace each triple with the digit 0 to 7 that it encodes. The binary string 11010110 pads to 011 010 110 and reads as 326 in octal.

Paste as many values as you like, one per line, and each is converted independently. Whitespace, underscores and commas inside a value are ignored, so bytes copied out of a datasheet as 1101_0110 still parse. A leading 0b is accepted and stripped. Anything that is not a 0 or a 1 stops the conversion with a message naming the offending character and the line it came from, rather than quietly producing a wrong number.

Turn on Group digits to space the octal output in threes for long values, or Add base prefix to emit 0o notation ready to paste into Python, Go or modern JavaScript. The reference table option appends the eight triple to digit mappings under the answer for quick manual checking. Octal is still the everyday notation for Unix file modes, so a converted value often belongs in the Unix Permission Calculator next. To go the other way, open Octal to Binary.

How to use

  1. Paste your binary values, one per line, into the left pane.
  2. Tick Add base prefix if you need 0o notation for source code.
  3. Tick Append reference table to print the triple lookup under the result.
  4. Copy the octal column or download it as a text file.

Common questions

Why three bits per octal digit?
Octal has eight symbols and three bits encode eight values, so each digit maps to exactly one triple with nothing left over.
What happens if my binary length is not a multiple of three?
The value is padded with leading zeros before grouping, which never changes its magnitude.
Can I paste spaced binary like 1101 0110?
Yes. Spaces, underscores and commas inside a single line are stripped before parsing, so nibble grouped input works.
Does it handle negative values?
A leading minus sign is preserved and the magnitude is converted, so -1010 becomes -12.