# Decimal to Octal and Octal to Decimal

This is the continuation of learning binary series.
You learned that binary is in the base two number system.
You also learned Hex is in the base 16 number system.
Well Octal is in the base 8 number system.
0 1 2 3 4 5 6 7

## Decimal to Octal

Example 1:
33
Since you know that Octal is in the base number system.
You divide 33 / 8
33 / 8 =  4
remainder 1  – Since you know 8 goes into 33 4 times and there is the number 1 left over
Then you take the number you got and divide that by 8
4 / 8 =  0
remainder none – Since you know goes into 4 0 times and there for the remainder is none.
Example 2:
98
You divide 98 / 8
98 / 8 = 12
Remainder 2 – Since you know 8 goes into 98 12 times and there is the number 2 left over
Then you take the number you got and divide that by 8
12 / 8 = 1
Remainder 4 – Since you know 8 goes into 12 1 time and there is the number left over
Then you take the number you got and divide that by 8
1 / 8 = 0
Remainder 1 – Since you know 8 goes into 1 0 times and there is the number 1 left over
You now take all the remainders you got and put them together. Last to first.

## Octal to Decimal

Example 1:
As you learned above octal is a base 8 number system,
0 1 2 3 4 5 6 7
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