How to Convert Octal to Binary and Vice Versa

💡
Key learnings:
  • Octal System Definition: The octal system is defined as a base-8 number system using digits from 0 to 7.
  • Binary System Definition: The binary system is defined as a base-2 number system using digits 0 and 1.
  • Direct Octal to Binary Conversion: Replace each octal digit with its three-bit binary equivalent.
  • Replace each octal digit with its three-bit binary equivalent.: Group binary digits into sets of three and convert each set to its octal equivalent.
  • Binary to Octal Conversion Examples: Converting binary numbers to octal numbers directly using grouping and conversion tables.

Octal and binary are number systems using 8 and 2 symbols, respectively. Octal uses 0-7, and binary uses 0 and 1. This article explains how to convert binary to octal and vice versa using direct and indirect methods.

What is Octal?

An octal number is a number that is written using the base-8 system. This means that each digit in an octal number represents a power of 8. For example, the octal number 1238 can be written as:

1238 = (1 × 8^2) + (2 × 8^1) + (3 × 8^0)

1238 = (64) + (16) + (3)

1238 = 83

The octal system simplifies reading and writing long binary numbers by grouping binary digits in sets of three. Each octal digit represents three binary digits. It was popular in early computing for machines with word sizes divisible by three.

What is Binary?

A binary number is a number that is written using the base-2 system. This means that each digit in a binary number represents a power of 2. For example, the binary number 10112 can be written as:

10112 = (1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (1 × 2^0)

10112 = (8) + (0) + (2) + (1)

10112 = 11

The binary system is essential in electronics and computers, representing the on (1) and off (0) states of electric signals. It forms the basis for binary code, which composes data in computer systems.

Direct Conversion from Octal to Binary

To convert an octal number to a binary number directly, we can use the following steps:

  • Step 1: Write down the octal number separating the digits.
  • Step 2: Convert each octal digit to its equivalent three-bit binary representation using this table:
OctalBinary
0000
1001
2010
3011
4100
5101
6110
7111
  • Step 3: Concatenate the binary digits in the same order as the octal digits.
  • Step 4: Remove any leading zeros if necessary.

For example, let us convert the octal number 1548 to binary:

  • Step 1: Write down the octal number separating the digits: 154
  • Step 2: Convert each octal digit to its equivalent three-bit binary representation using the table:
OctalBinary
1001
5101
4100
  • Step 3: Concatenate the binary digits in the same order as the octal digits: 001101100
  • Step 4: Remove any leading zeros if necessary: 1101100

Therefore, 1548 = 11011002.

Direct Conversion from Binary to Octal

To convert a binary number to an octal number directly, we can use the following steps:

  • Step 1: Write down the binary number separating the digits into groups of three starting from the rightmost digit. If necessary, add leading zeros to make a complete group of three.
  • Step 2: Convert each group of three binary digits to its equivalent octal digit using this table:
BinaryOctal
0000
0011
0102
0113
1004
1015
1106
1117
  • Step 3: Concatenate the octal digits in the same order as the groups of binary digits.

For example, let us convert the binary number 111002 to octal:

  • Step 1: Write down the binary number separating the digits into groups of three starting from the rightmost digit. If necessary, add leading zeros to make a complete group of three: 011 100
  • Step

Some additional steps are:

  • Step 2: Convert each group of three binary digits to its equivalent octal digit using the table:
BinaryOctal
0113
1004
  • Step 3: Concatenate the octal digits in the same order as the groups of binary digits: 34

Therefore, 111002 = 348.

Indirect Conversion from Octal to Binary

To convert an octal number to a binary number indirectly, we can use the decimal system as an intermediate step. The decimal system uses the base-10 and has 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. We can use the following steps:

  • Step 1: Convert the octal number to a decimal number by multiplying each digit by its corresponding power of 8 and adding them up. For example, to convert 348 to decimal, we can do the following:

348 = (3 × 8^2) + (4 × 8^1) + (8 × 8^0)

348 = (192) + (32) + (8)

348 = 232

  • Step 2: Convert the decimal number to a binary number by dividing it by 2 repeatedly and writing down the remainder in reverse order. For example, to convert 232 to binary, we can do the following:
DecimalQuotientRemainder
2321160
116580
58290
29141
1470
731
311
101

The binary number is obtained by reading the remainder from bottom to top: 111010002.

Therefore, 348 = 111010002.

Indirect Conversion from Binary to Octal

To convert a binary number to an octal number indirectly, we can also use the decimal system as an intermediate step. We can use the following steps:

  • Step 1: Convert the binary number to a decimal number by multiplying each digit by its corresponding power of 2 and adding them up. For example, to convert 11011002 to decimal, we can do:

11011002 = (1 × 2^6) + (1 × 2^5) + (0 × 2^4) + (1 × 2^3) + (1 × 2^2) + (0 × 2^1) + (0 × 2^0)

11011002 = (64) + (32) + (0) + (8) + (4) + (0) + (0)

11011002 = 108

  • Step 2: Convert the decimal number to an octal number by dividing it by 8 repeatedly and writing down the remainder in reverse order. For example, to convert 108 to octal, we can do the following:
DecimalQuotientRemainder
108134
1315
101

The octal number is obtained by reading the remainder from bottom to top: 1548.

Therefore, 11011002 = 1548.

Summary and Conclusion

In this article, we have learned how to convert octal to binary and binary to octal using two methods: direct conversion and indirect conversion through decimal. We have also seen some examples and exercises to practice these conversions. Here are some key points to remember:

  • Octal is a base-8 system that uses symbols from 0 to 7.
  • The binary is a base-2 system that uses the symbols from 0 and 1.
  • To convert octal to binary directly, we can replace each octal digit with its equivalent three-bit binary representation.
  • To convert binary to octal directly, we can group the binary digits into groups of three starting from the right and replace each group with its equivalent octal digit.
  • To convert octal to binary indirectly, we can first convert the octal number to a decimal number by multiplying each digit by its corresponding power of 8 and adding them up. Then, we can convert the decimal number to a binary number by dividing it by 2 repeatedly and writing down the remainder in reverse order.
  • To convert binary to octal indirectly, we can first convert the binary number to a decimal number by multiplying each digit by its corresponding power of 2 and adding them up. Then, we can convert the decimal number to an octal number by dividing it by 8 repeatedly and writing down the remainder in reverse order.

We hope this article has helped you understand how to convert octal to binary and binary to octal using different methods. You can use these conversions to work with different number systems in electronics and computing. You can also check your answers using online converters such as this one. Happy converting!

Want To Learn Faster? 🎓
Get electrical articles delivered to your inbox every week.
No credit card required—it’s 100% free.

About Electrical4U

Electrical4U is dedicated to the teaching and sharing of all things related to electrical and electronics engineering.