# Introduction to Octal Numbers

By this point you should be quite familiar with binary (and obviously decimal) numbers.
Octal is going to work the same but instead of 0 and 1 we have 0 to 7 for each digit.
Likewise each place value is \(2^n\) where \(n\) is the position (starting at 0 for rightmost digit).

fact

The place value for the n

^{th}digit from the right of an octal number (n beginning at 0) is given by \(2^n\).fact

Octal numbers are written with the subscript \(_8\) when it might not be clear what base the number is in.

fact

The first 6 place values for octal numbers are:

Place | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|

Value | 32768 | 4096 | 512 | 64 | 8 | 1 |

fact

To convert an octal number to decimal just multiply each digit by its place value and add the results.

example

Convert \(23_8\) to decimal

Breaking this number into place values: $$23_8 = 2\times 8 + 3\times 1 = 16 + 3 = 19_{10}$$example

Convert \(101_8\) to decimal

$$\begin{align} 101_8 & = 1\times 64 + 0\times 8 + 1\times 1 \\ & = 65_{10} \\ \end{align}$$fact

To convert a decimal number to octal:

- Divide decimal number by 8
- Write remainder of division as next octal digit (moving right to left)
- Repeat Step 1 with the integer result of the division until we're left with 0

example

Convert \(100_{10}\) to octal.

It's usually easiest to do this in a table as you work: I like to call this the SOAR table which stands for: S: Step O: Operation A: Answer R: RemainderS | O | A | R |
---|---|---|---|

1 | \(\frac{100}{8}\) | 12 | 4 |

2 | \(\frac{12}{8}\) | 1 | 4 |

3 | \(\frac{1}{8}\) | 0 | 1 |

fact

To convert an octal number to binary first convert it to decimal and then convert that decimal number into binary

example

Convert \(23_8\) into binary

As we found above \(23_8 = 19_{10}\) Now we just convert \(19_{10}\) to binary to get: $$19_{10} = 10011_2$$ So we get: $$23_8 = 10011_2$$ There's a handy quick little shortcut to converting an octal number into binary. It's not necessary to know it but it can save you some valuable time when you're taking a test.

fact

As a shortcut to convert an octal number to binary convert each octal digit to a 3-bit binary number, placing them next to each other in order will give you the binary value of the number.

example

Convert \(240_8\) to binary using the shortcut method.

We'll right out the 3-digit binary value of each digit below the number: $$\begin{align} \phantom{0}2\phantom{00}4\phantom{0\,0}0_8\, & \\ 010\;100\;000 & \end{align}$$ And we can read the answer right off of this: $$240_8 = 010100000_2$$fact

A shortcut to convert binary to octal is to:

- Divide binary number into groups of 3 (starting from right)
- Convert each 3-digit binary number to an octal digit (it'll be the same as the decimal value)
- Write these binary digits in order

example

Convert \(10101_2\) to octal using the shortcut method.

Our two groups are \(010\) and \(101\) (we added a leading zero to the leftmost group to make it 3-digits) Now we convert each of these two groups to octal. $$010_2 = 2_8$$ $$101_2 = 5_8$$ So our octal number is: $$10101_2 = 25_8$$
practice problems