FormatterHQ

Binary to Octal Converter

Convert binary numbers to octal in one step. Each group of three bits becomes one octal digit, which makes permission bits like 111101101 read as 755.

Loading tool…
Ready.

How to use the Binary to Octal Converter

  1. Type or paste a binary number in the Binary field.
  2. Read the octal value in the Octal field, which updates as you type.
  3. Copy the result for your script, notes or exercise.

Binary to octal with 3-bit groups

This binary to octal converter turns strings of 0s and 1s into base-8 numbers. Because 8 = 2^3, every three bits map to exactly one octal digit, so the conversion is a simple regrouping rather than a calculation.

The 3-bit table

Bits000001010011100101110111
Octal01234567

Worked example

Split the bits into threes starting from the right, pad the leftmost group with zeros, then replace each group with its digit.

10110011
→ 10 110 011
→ 010 110 011
→ 2   6   3     = 263

After a binary point, group to the right and pad the last group with zeros. 101.101 is 101 . 101, or 5.5 in octal, and 111101101.1 becomes 755.4.

Reading permission bits

Unix stores read, write and execute permission as three bits for the owner, three for the group and three for everyone else. Converting the nine bits to octal gives the familiar chmod number.

Bits        Octal   Meaning
111101101   755     rwx r-x r-x
110100101   645     rw- r-- r-x
110100100   644     rw- r-- r--

In each triple the bits are worth 4 (read), 2 (write) and 1 (execute), so 101 means read + execute = 5.

Example output

Input        Output
1010         12
11111111     377
100000000    400
101.101      5.5

Input notes

  • Spaces, commas and underscores are ignored, so the triples may stay spaced out: 111 101 101 is read as 111101101. The field holds one number at a time.
  • A 0b prefix and a minus sign are accepted; other characters are flagged with the invalid digit highlighted.
  • Long values convert exactly, however many bits they have.

Common mistakes

  • Starting the groups at the left. 11111111 grouped as 111 111 11 would suggest 7, 7 and 3, but the correct grouping from the right is 11 111 111, which is 377.
  • Padding a fraction on the wrong side. 0.1 in binary becomes 0.100, which is 0.4 in octal, not 0.1.

Octal or hex?

Octal suited early machines with 12-, 24- and 36-bit words, which divide evenly into 3-bit digits. Modern byte-oriented systems prefer hexadecimal, because a byte splits into two 4-bit digits but not into whole 3-bit ones. Use binary to hex for bytes and addresses, and octal for permissions. To reverse this conversion, use octal to binary, or decimal to octal if your value starts in base 10.

Frequently asked questions

Why group binary digits in threes for octal?
Three bits have 2^3 = 8 possible patterns, matching the eight octal digits 0–7. Each group therefore converts independently of the others.
What is 11111111 in octal?
It is 377. Grouped from the right it reads 11 111 111, and after padding, 011 111 111, which is 3, 7 and 7.
How do I pad a binary number that is not a multiple of three bits?
Add zeros on the left of the whole-number part until its length is a multiple of three. After a binary point, add zeros on the right instead. The converter handles both automatically.
Is octal still used in programming?
Yes, mainly for Unix file modes (chmod 644, umask 022) and octal escape sequences such as \033. Most other low-level work has moved to hexadecimal.
How do I convert binary to octal in code?
Parse the bits as a base-2 integer and print it in base 8. In JavaScript that is parseInt("11111111", 2).toString(8), which returns "377"; in Python format(int("11111111", 2), "o") does the same, and C can print an integer with printf("%o"). For very long bit strings, use BigInt in JavaScript to avoid losing precision.
Why does one byte need three octal digits?
Eight bits do not divide evenly into 3-bit groups: they split as 2 + 3 + 3. The leftmost digit can therefore only be 0 to 3, which is why a byte ranges from 000 to 377 in octal. This mismatch is the main reason hexadecimal replaced octal for byte-oriented data.

Last updated October 3, 2026

Related tools