# Binary to Octal Conversion

In binary to octal conversion, we learn to convert base 2 number system into base 8 number system. We cannot directly convert binary to octal, so we first convert binary to decimal, then the decimal number to the equivalent octal number system. Binary numbers are commonly used in computers, in the form of bits and bytes, since the computer understand the language of 0 and 1 only. At the same time, octal numbers are used in electronics. Before going to the conversion, we have to learn about octal and binary numbers.

**What are Binary Numbers?**

Numbers to base 2 is called binary numbers. It uses only two digits, 0 and 1. It is denoted by a_{2}, where a is a number with 0’s and 1’s.

**Examples:**

- 111110
_{2} - 1111111
_{2} - 1011001
_{2}

**What are Octal numbers?**

The number to the base 8 is called octal numbers. It uses the numbers from 0 to 7. The numbers 8 and 9 are not included in the octal number system. It is denoted by a_{8} where a is a number with digits 0 to 7.

**Examples: **

- 2145
_{8} - 7165
_{8} - 46
_{8}

## Conversion from Binary to Octal

In number system, you will come across different types of numbers such as binary, octal, decimal and hexadecimal. To convert binary numbers to octal numbers, follow the below steps:

- Take the given binary number
- Multiply each digit by 2
^{n-1}where n is the position of the digit from the decimal - The resultant is the equivalent decimal number for the given binary number
- Divide the decimal number by 8
- Note the remainder
- Continue the above two steps with the quotient till the quotient is zero
- Write the remainder in the reverse order
- The resultant is the required octal number for the given binary number

**Also read:**

Here is a table for decimal number and equivalent octal number, to solve the problems based on their conversion more quickly.

Decimal Number | Octal Number |

0 | 0 |

1 | 01 |

2 | 010 |

3 | 011 |

4 | 100 |

5 | 101 |

6 | 110 |

7 | 111 |

### Binary to Octal conversion Examples

**Example 1:** **Convert 1010101 _{2} to octal**

**Solution:**

Given binary number is 1010101_{2}

First, we convert given binary to decimal

1010101_{2 }= (1 * 2^{6}) + (0 * 2^{5 }) + (1 * 2^{4}) + (0 * 2^{3}) + (1 * 2^{2}) + (0 * 2^{1}) + (1 * 2^{0})

= 64 + 0 + 16 + 0 + 4 + 0 + 1

= 64 + 21

010101_{2}= 85 (Decimal form)

Now we will convert this decimal to octal form

Therefore, the equivalent octal number is 125_{8}.

**Example 2: Convert 01101 _{2} to octal**

**Solution:**

Given binary number is 01101_{2}

First we convert given binary to decimal

01101_{2 }= (0 * 2^{4}) + (1 * 2^{3}) + (1 * 2^{3}) + (0 * 2) + (1 *2^{0})

= 0 + 8 + 4 + 0 +1

01101_{2}= 13 (Decimal form)

Now we will convert this decimal to octal form

Therefore, the equivalent octal number is 15_{8}.

Register with BYJU’S – The Learning App for more Maths-related concepts and explore exciting videos.