Hexadecimal gets all the attention, but octal – base 8 – is still used in Unix file permissions, legacy systems, and embedded programming. If you can convert binary to hexadecimal, converting binary to octal is even easier: you just group bits in threes instead of fours.
What Is the Octal Number System?
Octal is a base-8 number system that uses the digits 0 through 7. Each octal digit represents exactly three binary bits, which makes conversion between the two nearly mechanical.
| Octal Digit | 3-Bit Binary |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
Memorize this table (or bookmark this page) and you can convert in either direction without any arithmetic. To double-check a result, use our binary converter and compare the decimal values.
How to Convert Binary to Octal in 3 Steps
Step 1: Starting from the rightmost bit, group the binary number into chunks of 3 bits.
Step 2: If the leftmost group has fewer than 3 bits, pad it with leading zeros.
Step 3: Replace each 3-bit group with its octal digit from the table above.
That’s it – no multiplication, no powers of two.
Worked Example 1: 1010110 to Octal
Take the binary number 1010110:
- Group from the right: `1` `010` `110`
- Pad the leftmost group: `001` `010` `110`
- Convert each group: `001`→1, `010`→2, `110`→6
Result: 126 (octal).
Verification: 126 octal = 1×64 + 2×8 + 6 = 64 + 16 + 6 = 86. And 1010110 binary = 64 + 16 + 4 + 2 = 86. ✓
Worked Example 2: 11111111 to Octal
Take 11111111 (eight ones):
- Group from the right: `011` `111` `111`
- Convert: 3, 7, 7
Result: 377 (octal).
Verification: 377 octal = 3×64 + 7×8 + 7 = 192 + 56 + 7 = 255. And 11111111 binary = 255. ✓ Notice that 255 decimal = FF hex = 377 octal – the same value in three bases.
Worked Example 3: 10011010 to Octal
Take 10011010:
- Group from the right: `010` `011` `010` (pad leftmost: `010`)
- Convert: 2, 3, 2
Result: 232 (octal).
Verification: 232 octal = 2×64 + 3×8 + 2 = 128 + 24 + 2 = 154. And 10011010 = 128 + 16 + 8 + 2 = 154. ✓
Converting Octal Back to Binary
The reverse is even simpler – expand each octal digit into its 3-bit group:
- 53 (octal) → 5=`101`, 3=`011` → 101011 binary
- 17 (octal) → 1=`001`, 7=`111` → 1111 binary (drop the leading zeros)
- 640 (octal) → 6=`110`, 4=`100`, 0=`000` → 110100000 binary
Check 640 octal: 6×64 + 4×8 + 0 = 384 + 32 = 416. And 110100000 = 256 + 128 + 32 = 416. ✓
You can verify any of these instantly with a binary converter – paste the binary string and compare the decimal output.
Octal vs Hexadecimal: When Is Octal Used?
Hexadecimal won the popularity contest because one hex digit maps to exactly 4 bits (a nibble), and modern bytes are 8 bits – two clean hex digits. Octal maps to 3 bits, which doesn’t divide 8 evenly, so it fell out of favor for general use.
But octal survives in specific places:
- Unix/Linux file permissions – `chmod 755`, `chmod 644`. Each digit is a 3-bit permission set (read=4, write=2, execute=1), which is why octal is the natural notation.
- Legacy mainframes and PDP systems – built on 12/18/36-bit words divisible by 3.
- UTF-8 and C escape sequences – `101` is octal for ‘A’ (65 decimal).
Common Mistakes
Grouping from the left. Always start grouping from the rightmost (least significant) bit. Grouping `1010110` from the left as `101` `011` `0` gives 5, 3, 0 → 530 octal, which is wrong.
Forgetting to pad. The leftmost group must be padded to 3 bits with leading zeros. `1010110` groups as `001` `010` `110`, not `1` `010` `110` – though in this case both give the same digits, padding matters for correctness in general.
Using digits 8 or 9. Octal only has digits 0-7. If your result contains an 8 or 9, something went wrong.
Frequently Asked Questions
What is 1010 in octal?
1010 binary groups as `001` `010` → 1, 2 → 12 octal. Verification: 12 octal = 1×8 + 2 = 10 decimal, and 1010 binary = 8 + 2 = 10. ✓
What is 777 in binary?
Expand each digit: 7=`111`, 7=`111`, 7=`111` → 111111111 binary (nine ones = 511 decimal). Check: 777 octal = 7×64 + 7×8 + 7 = 448 + 56 + 7 = 511. ✓
Is octal still used today?
Yes – mainly in Unix file permissions (chmod 755) and C-style octal escape sequences (` `, `101`). It’s rare in new designs but essential knowledge for systems programming.
Why 3 bits per octal digit?
Because 2³ = 8. Each octal digit can represent exactly 8 values (0-7), which is precisely what 3 binary bits can represent. This one-to-one mapping is what makes the conversion mechanical.
How do I convert decimal to octal?
Repeatedly divide by 8 and read the remainders bottom-to-top. For 86: 86÷8=10 r6, 10÷8=1 r2, 1÷8=0 r1 → 126 octal. Matches our binary example above. ✓