How to Convert Binary to Octal (and Octal to Binary)

Octal (base 8) is less common than decimal or hexadecimal, but it still appears in computer science courses and on Linux servers, where file permissions such as 755 are written in octal. If you need to know how to convert binary to octal, you are in luck: because 8 is 2 × 2 × 2, every octal digit corresponds to exactly three binary digits. No division required – just grouping.

Screenshot of the Number Base Converter on Assen Tools
The Number Base Converter in use. Open the Number Base Converter – free, no sign-up.

The 3-bit lookup table

Memorise (or keep handy) these eight pairs:

  • 000 = 0
  • 001 = 1
  • 010 = 2
  • 011 = 3
  • 100 = 4
  • 101 = 5
  • 110 = 6
  • 111 = 7

Binary to octal: group in threes from the right

  1. Starting from the right, split the binary number into groups of three digits.
  2. If the leftmost group has fewer than three digits, add zeros in front.
  3. Replace each group with its octal digit from the table.

Example 1: 110101

Groups: 110 | 101 → 6 | 5 → 65 in octal.

Check: 6 × 8 + 5 = 53, and 110101 in binary is also 53.

Example 2: 1011101

Groups from the right: 1 | 011 | 101 → pad the first group to 001 → 1 | 3 | 5 → 135 in octal.

Check: 1 × 64 + 3 × 8 + 5 = 93, and 1011101 = 64 + 16 + 8 + 4 + 1 = 93.

Octal to binary: expand each digit

Going the other way is even easier. Replace every octal digit with its three-bit group.

Example: 527

5 → 101, 2 → 010, 7 → 111 527 in base 8 = 101010111 in binary.

You can drop any leading zeros from the final answer. For instance, octal 17 becomes 001 111, which is written 1111.

Linux permissions example

On a Linux server, chmod 755 means:

  • 7 = 111 → read, write, execute for the owner
  • 5 = 101 → read and execute for the group
  • 5 = 101 → read and execute for everyone else

Each bit switches one permission on or off, which is exactly why octal is used.

The same trick works for hexadecimal

Hexadecimal (base 16) groups binary in fours, because 16 = 2⁴:

110101 → 0011 | 0101 → 3 | 5 → 35 in hex (which is 53 in decimal).

Hex is used for colour codes, memory addresses and MAC addresses. Our guide how to convert decimal to hexadecimal covers it in detail.

Why octal exists at all

Early computers used word sizes that were multiples of three bits, such as 12, 24 and 36 bits, so octal was a natural shorthand. Today hexadecimal is more common because modern computers use 8, 16, 32 and 64-bit words, which divide neatly into groups of four. Octal survives mainly in Unix file permissions, some aviation transponder codes and computer science courses, which is why it still appears in exams.

Common mistakes

  • Grouping from the left. Always start grouping from the right-hand end, or you will get the wrong digits.
  • Using 8 or 9 in an octal number. Octal digits only go from 0 to 7.
  • Forgetting to pad the first group with zeros.

Check your work

The free Number Base Converter converts between binary, octal, decimal and hexadecimal instantly – type in any box and the others update. It shows grouped binary digits, which makes it ideal for checking homework step by step.

For the basics of reading binary, see how to convert binary to decimal. If your binary is actually text, use the Binary Converter.

Summary

Now you know how to convert binary to octal: group the bits in threes from the right, pad the first group, and swap each group for its octal digit. To go back, expand each octal digit into three bits. The same idea with groups of four gives you hexadecimal. Practise with the free Number Base Converter.

Jonathan Nwachukwu, founder of Assen Tools

Written by

Jonathan Nwachukwu · Founder & developer

Jonathan is a freelance web developer and web development teacher who builds Laravel, WordPress and WooCommerce sites for clients. He built AssenTools to put the everyday file, photo and calculation jobs he kept doing for clients and students into one free, private toolbox, and he maintains every tool and guide on the site.