Binary to Octal Converter
Going the other way? Convert octal back to binary →
How do you convert binary to octal?
Binary to octal conversion works in groups of 3 bits, because one octal digit is worth exactly 3 bits, so no arithmetic is needed.
Binary 1010111100 is octal 1274. Group the bits in threes from the right, pad the left group with zeros (001 010 111 100), then convert each group: 1, 2, 7, 4.
- Split the binary digits into groups of 3, starting from the right.
- Pad the leftmost group with zeros if it is short.
- Replace each group with its octal digit from the table.
- Join the digits in order: 1010111100 = 1274.
Binary to Octal Conversion Table
One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary. That is the whole method, so the table below is the only thing you need: every group of 3 bits has exactly one octal digit, and the mapping never changes. Binary writes values on the digit set 0, 1 with each place worth 2ⁿ, and a value marked 0b is binary; octal values are marked 0o.
| 3 bits | Octal | Decimal |
|---|---|---|
| 000 | 0 | 0 |
| 001 | 1 | 1 |
| 010 | 2 | 2 |
| 011 | 3 | 3 |
| 100 | 4 | 4 |
| 101 | 5 | 5 |
| 110 | 6 | 6 |
| 111 | 7 | 7 |
Each base is defined by three things: which digits it uses, how a value is marked, and what each position is worth.
| Base | Radix | Digits | Prefix | Place worth | Typical range |
|---|---|---|---|---|---|
| Binary | 2 | 0, 1 | 0b | 2ⁿ | 8-bit byte 0–255 (00000000–11111111); 4-bit nibble 0–15; 16/32/64-bit words |
| Octal | 8 | 0–7 | 0o | 8ⁿ | 3 digits cover a byte (000–377); Unix permissions 000–777 |
Worked Example: 1010111100 to Octal
One value, converted the long way so the working is visible. This is the same grid the converter shows when you turn on "show steps".
Result: 1010111100 = 1274
Both bases here are powers of two, so no division is needed. One octal digit is worth exactly 3 bits, which means the conversion is a regrouping of the same bits rather than a change of value.
Written out, 1010111100 is 1010111100 in binary. Regrouping those bits into 3s from the right, and padding the leftmost group with zeros if it is short, gives 1274. Counting the groups from the left instead is where this goes wrong: the padding then lands on the wrong end and every digit shifts.
Check it in reverse
The value returns unchanged. Convert 1274 back and you get 1010111100, because a base change rewrites the digits without touching the quantity they stand for. That is the whole test: if the round trip differs, a digit was misread. To check it by hand, convert the binary result back to octal and compare it with the number you started from.
Worked examples: binary to octal
Each example gives the value first, then the working. Click a value to load it in the converter.
What is 0b10101 in octal?
0b10101 in binary is 25 in octal.
Method: regroup the bits in threes; 10101 is 10101 in binary.
What is 0b1101 in octal?
0b1101 in binary is 15 in octal.
Method: regroup the bits in threes; 1101 is 1101 in binary.
What is 0b110101 in octal?
0b110101 in binary is 65 in octal.
Method: regroup the bits in threes; 110101 is 110101 in binary.
What is 0b100111010 in octal?
0b100111010 in binary is 472 in octal.
Method: regroup the bits in threes; 100111010 is 100111010 in binary.
What is 0b1010111100 in octal?
0b1010111100 in binary is 1274 in octal.
Method: regroup the bits in threes; 1010111100 is 1010111100 in binary.
What is 0b1010 in octal?
0b1010 in binary is 12 in octal.
Method: regroup the bits in threes; 1010 is 1010 in binary.
What is 0b1100100 in octal?
0b1100100 in binary is 144 in octal.
Method: regroup the bits in threes; 1100100 is 1100100 in binary.
What is 0b11111111 in octal?
0b11111111 in binary is 377 in octal.
Method: regroup the bits in threes; 11111111 is 11111111 in binary.
What is 0b1000 in octal?
0b1000 in binary is 10 in octal.
Method: regroup the bits in threes; 1000 is 1000 in binary.
What is 0b10000 in octal?
0b10000 in binary is 20 in octal.
Method: regroup the bits in threes; 10000 is 10000 in binary.
What is 0b100000 in octal?
0b100000 in binary is 40 in octal.
Method: regroup the bits in threes; 100000 is 100000 in binary.
What is 0b1000000 in octal?
0b1000000 in binary is 100 in octal.
Method: regroup the bits in threes; 1000000 is 1000000 in binary.
Every example above reverses exactly — expand the same octal digits into bits.
What About Padding, Fractions and Width?
Leading zeros and width
A number carries no leading zeros unless a width is fixed. 1274 and 01274 are the same value, so the converter writes the short form. Fixed widths belong to bytes and registers, not to arithmetic. the two universal conversion methods covers where width does matter.
Fractions and the point
Digits after a point convert by the same rule with negative powers, so the first place after the point is worth 1/8. Many fractions that end neatly in decimal repeat forever in binary, which is where rounding creeps in.
Negative values
A minus sign is kept in front of the digits. Fixed-width binary encodes sign differently, using two's complement, and that is a separate rule from the base change itself.
How large a value can be
The method has no ceiling; each extra binary digit multiplies the range by 2. Practical limits come from the width a machine stores the value in, not from the conversion.
Binary to Octal in Code
The same rule in one line. Both group the bits and return the octal digits.
Python: format(int('1010111100', 2), 'o') JavaScript: parseInt('1010111100', 2).toString(8) Common Mistakes
- Reading the remainders top to bottom. They come out in reverse, so the digits land backwards.
- Using a digit the base does not have — an 8 in octal, or a 2 in binary. The value cannot be read at all.
- Grouping bits from the left. Groups are counted from the right, and the leftmost group is the one that gets padded.
- Treating the result as a character code. 1000001 is a number here, not the letter A.
Frequently Asked Questions
Can you give binary to octal practice questions with answers?
Yes. Work these out: 1101 = 15, 10101 = 25, 110101 = 65, 100111010 = 472 and 1010111100 = 1274. Group each from the right in threes, pad the leftmost group, then convert one group at a time.
Why are binary digits grouped in threes for octal?
Because three bits cover the octal digit set, 0–7. One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary.
Can you convert binary to octal through decimal?
Yes, but it is the long way round. 1010111100 comes to 700 in decimal, and dividing 700 by 8 repeatedly returns 1274. Grouping the bits in threes reaches the same digits with no arithmetic.
Bit grouping runs both ways, so the same value converts straight back in the octal to binary direction.
Related Conversions
The rest of the family sits on every binary converter.