Octal to Binary Converter
Going the other way? Convert binary back to octal →
How do you convert octal to binary?
Octal to binary conversion works in groups of 3 bits, because one octal digit is worth exactly 3 bits, so no arithmetic is needed.
Octal 472 is binary 100111010. Replace each octal digit with its 3-bit value (4 = 100, 7 = 111, 2 = 010) and join the groups; drop leading zeros unless a fixed width is required.
- Take the first octal digit.
- Write it as 3 binary digits from the table.
- Repeat for every digit, keeping the order.
- Join the groups and drop any leading zeros: 472 = 100111010.
Octal to Binary 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 |
|---|---|---|---|---|---|
| Octal | 8 | 0–7 | 0o | 8ⁿ | 3 digits cover a byte (000–377); Unix permissions 000–777 |
| Binary | 2 | 0, 1 | 0b | 2ⁿ | 8-bit byte 0–255 (00000000–11111111); 4-bit nibble 0–15; 16/32/64-bit words |
Worked Example: 472 to Binary
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: 472 = 100111010
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, 472 is 100111010 in binary. Regrouping those bits into 3s from the right, and padding the leftmost group with zeros if it is short, gives 100111010. 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 100111010 back and you get 472, 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 octal result back to binary and compare it with the number you started from.
Worked examples: octal to binary
Each example gives the value first, then the working. Click a value to load it in the converter.
What is 0o472 in binary?
0o472 in octal is 100111010 in binary.
Method: regroup the bits in threes; 472 is 100111010 in binary.
What is 0o157 in binary?
0o157 in octal is 1101111 in binary, or 001101111 with the leading zeros kept.
Method: regroup the bits in threes; 157 is 1101111 in binary.
What is 0o755 in binary?
0o755 in octal is 111101101 in binary.
Method: regroup the bits in threes; 755 is 111101101 in binary.
What is 0o1274 in binary?
0o1274 in octal is 1010111100 in binary, or 001010111100 with the leading zeros kept.
Method: regroup the bits in threes; 1274 is 1010111100 in binary.
What is 0o12 in binary?
0o12 in octal is 1010 in binary, or 001010 with the leading zeros kept.
Method: regroup the bits in threes; 12 is 1010 in binary.
What is 0o144 in binary?
0o144 in octal is 1100100 in binary, or 001100100 with the leading zeros kept.
Method: regroup the bits in threes; 144 is 1100100 in binary.
What is 0o377 in binary?
0o377 in octal is 11111111 in binary, or 011111111 with the leading zeros kept.
Method: regroup the bits in threes; 377 is 11111111 in binary.
What is 0o10 in binary?
0o10 in octal is 1000 in binary, or 001000 with the leading zeros kept.
Method: regroup the bits in threes; 10 is 1000 in binary.
What is 0o20 in binary?
0o20 in octal is 10000 in binary, or 010000 with the leading zeros kept.
Method: regroup the bits in threes; 20 is 10000 in binary.
What is 0o40 in binary?
0o40 in octal is 100000 in binary.
Method: regroup the bits in threes; 40 is 100000 in binary.
What is 0o100 in binary?
0o100 in octal is 1000000 in binary, or 001000000 with the leading zeros kept.
Method: regroup the bits in threes; 100 is 1000000 in binary.
What is 0o200 in binary?
0o200 in octal is 10000000 in binary, or 010000000 with the leading zeros kept.
Method: regroup the bits in threes; 200 is 10000000 in binary.
Every example above reverses exactly — run the same value the other way, binary to octal.
What About Padding, Fractions and Width?
Leading zeros and width
A number carries no leading zeros unless a width is fixed. 100111010 and 0100111010 are the same value, so the converter writes the short form. Fixed widths belong to bytes and registers, not to arithmetic. how any base converts to any other 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/2. 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 octal digit multiplies the range by 8. Practical limits come from the width a machine stores the value in, not from the conversion.
Octal to Binary in Code
The same rule in one line. Both group the bits and return the binary digits.
Python: format(int('472', 8), 'b') JavaScript: parseInt('472', 8).toString(2) 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. 101 is a number here, not the letter A.
Frequently Asked Questions
Is 8 a valid octal digit?
No. Octal has eight digits, 0–7, because counting starts at 0. An 8 in the input carries no place value, so the number cannot be read; the decimal number 8 is 10 in octal.
What is the octal to binary table?
It is the eight-row map from each octal digit to its 3 bits: 0 = 000, 1 = 001, 2 = 010, 3 = 011, 4 = 100, 5 = 101, 6 = 110, 7 = 111. Replace each digit in place and join the groups in order.
Do you drop the leading zeros of the first group?
Yes, at the very front only. Every digit still expands to a full 3 bits, so 157 becomes 001 101 111, and the joined run drops its two leading zeros: 1101111. A fixed width keeps them.
How do you convert octal to binary in Python?
Read the digits as base 8, then format the value in base 2: format(int('472', 8), 'b') returns 100111010. Python marks the bases with prefixes: 0o472 in octal, 0b100111010 in binary.
The bits are only regrouped, so the same value converts straight back in the binary to octal direction.
Related Conversions
The rest of the family sits on the rest of the binary converters in this family.