# Decimal to Octal and Octal to Decimal

This is the continuation of learning binary series.

You learned that ** binary **is in the base

**number system.**

*two*You also learned

**is in the base**

*Hex***number system.**

*16*Well

**is in the base**

*Octal***number system.**

*8*0 1 2 3 4 5 6 7

## Decimal to Octal

**Example 1: **

Lets start with a decimal number

33

Since you know that * Octal *is in the base

*number system.*

**8**You divide 33 / 8

33 / 8 = 4

remainder 1 – Since you know

*goes into*

**8***times and there is the number*

**33****4***left over*

**1**Then you take the number you got and divide that by

*4 / 8 = 0*

**8**

remainder none – Since you know

*goes into*

**8***times and there for the remainder is none.*

**4 0**So the answer is

**41**

**Example 2:**

Lets start with another decimal number

98

You divide 98 / 8

98 / 8 = 12

Remainder 2 – Since you know

*goes into*

**8***times and there is the number*

**98 12***left over*

**2**Then you take the number you got and divide that by

**8**12 / 8 = 1

Remainder 4 – Since you know

*goes into*

**8***time and there is the number*

**12 1***left over*

**4**Then you take the number you got and divide that by

**8**1 / 8 = 0

Remainder 1 – Since you know

*goes into*

**8***times and there is the number*

**1 0****1**left over

You now take all the remainders you got and put them together. Last to first.

So the answer is

**142**## Octal to Decimal

**Example 1:
**As you learned above octal is a base

*number system,*

**8**0 1 2 3 4 5 6 7

Lets start with an octal number

238

2 | 3 | 8

Each digit is multiplied by 8 by its power

2 | 1 | 0

2 × 8² + 3 × 8¹ + 8 × 8⁰ – You now solve this with PEMDAS

P(parenthesis)-E(exponents)-M(multiplication)-D(division) -A(addition)-S(subtraction)

You solve the exponents then the multiplication and then addition

2 × 64 + 3 × 8 + 8

128 + 24 + 8 = 152

**Example 2:**

Lets start with another octal number

7050

7 | 0 | 5 | 0

Each digit is multiplied by 8 by its power

3 | 2 | 1 | 0

7 × 8³ + 0 × 8² + 5 × 8¹ + 0 × 8⁰

7 × 512 + 0 × 64 + 5 × 8 + 0

3584 + 0 + 40 + 0 = 3624