Number Bases
Senior 3 · Mathematics
Number Bases
Lesson 2 of 5
24 min
In base two the year 2026 is written . Converting into base ten, as in the last lesson, means multiplying by powers of the base and adding. Converting out of base ten reverses this: you divide by the base again and again, and the remainders are the digits. This lesson also shows how to move between two bases that are not ten, and a shortcut that links bases 2, 8 and 16.
Definition
Octal and hexadecimal: the names of base eight and base sixteen. Binary is base two, and decimal is base ten.
Notation: is an octal numeral; is a hexadecimal (often shortened to "hex") numeral.
Example: , and 15 in hexadecimal is the single digit .
Important
Rule (base ten to base ). Divide the number by and write down the remainder. Divide the quotient by again, and repeat until the quotient is 0. The remainders, read from the last to the first, are the digits of the number in base .
Why: each division writes a number as . So , then , and so on. Substituting, : the first remainder is the ones digit, the second is the s digit, and the last remainder is the leading digit.
Worked example 1: 2026 in base two
| Division | Quotient | Remainder |
|---|---|---|
| 1013 | 0 | |
| 506 | 1 | |
| 253 | 0 | |
| 126 | 1 | |
| 63 | 0 | |
| 31 | 1 | |
| 15 | 1 | |
| 7 | 1 | |
| 3 | 1 | |
| 1 | 1 | |
| 0 | 1 |
Read the remainders from the bottom up: .
Check: . ✓
Worked example 2: 2026 in base five and in base sixteen
Base five
| Division | Quotient | Remainder |
|---|---|---|
| 405 | 1 | |
| 81 | 0 | |
| 16 | 1 | |
| 3 | 1 | |
| 0 | 3 |
So . Check: . ✓
Base sixteen (remainders of 10 or more become letters)
| Division | Quotient | Remainder |
|---|---|---|
| 126 | 10 (= A) | |
| 7 | 14 (= E) | |
| 0 | 7 |
So . Check: . ✓
Learn to read this table in every direction. Notice where each base "rolls over" to a new place: at 2, 4, 8 and 16 in base two, at 5 in base five, at 8 in base eight and at 16 in base sixteen.
| Base ten | Base two | Base five | Base eight | Base sixteen |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 | 2 |
| 3 | 11 | 3 | 3 | 3 |
| 4 | 100 | 4 | 4 | 4 |
| 5 | 101 | 10 | 5 | 5 |
| 6 | 110 | 11 | 6 | 6 |
| 7 | 111 | 12 | 7 | 7 |
| 8 | 1000 | 13 | 10 | 8 |
| 9 | 1001 | 14 | 11 | 9 |
| 10 | 1010 | 20 | 12 | A |
| 11 | 1011 | 21 | 13 | B |
| 12 | 1100 | 22 | 14 | C |
| 13 | 1101 | 23 | 15 | D |
| 14 | 1110 | 24 | 16 | E |
| 15 | 1111 | 30 | 17 | F |
| 16 | 10000 | 31 | 20 | 10 |
Worked example 3: between two bases that are not ten
Convert to base eight.
Solution Go through base ten. First, . Then divide by 8:
| Division | Quotient | Remainder |
|---|---|---|
| 26 | 6 | |
| 3 | 2 | |
| 0 | 3 |
So . Check: . ✓
Because , three binary places together are worth exactly one octal place; because , four binary places are worth one hexadecimal place. So each octal digit is a block of 3 bits, and each hexadecimal digit is a block of 4 bits.
| Octal digit | 3 bits | Hex digit | 4 bits | Hex digit | 4 bits |
|---|---|---|---|---|---|
| 0 | 000 | 8 | 1000 | 0 | 0000 |
| 1 | 001 | 9 | 1001 | 1 | 0001 |
| 2 | 010 | A | 1010 | 2 | 0010 |
| 3 | 011 | B | 1011 | 3 | 0011 |
| 4 | 100 | C | 1100 | 4 | 0100 |
| 5 | 101 | D | 1101 | 5 | 0101 |
| 6 | 110 | E | 1110 | 6 | 0110 |
| 7 | 111 | F | 1111 | 7 | 0111 |
Worked example 4: grouping bits
(a) Write in octal and in hexadecimal. (b) Write in binary.
Solution
(a) Octal: group the bits in threes from the right: , which gives . So .
Hexadecimal: group in fours from the right: , which gives . So , the same as in Worked example 2. ✓
(b) Replace each hex digit by 4 bits: and . So (the leading zeros can be dropped). Check: . ✓
Warning
Two direction mistakes. Read the remainders from the bottom up: the first remainder is the ones digit, not the leading digit. And group bits from the right, adding zeros on the left if the last group is short: is , not .
Tip
Always convert back. After converting out of base ten, turn your answer back into base ten with place values. If you do not get the number you started with, look for a remainder written in the wrong order.
Khan Academy: Converting from decimal to binary (4 min). Watch how a base-ten number is built from the largest power of 2 that fits, one place at a time. It is a second method you can use to check the repeated-division method in this lesson.
Practice
Check every answer by converting back. The last three are harder.
Sources and credits
The Rwandan worked examples, the diagrams, the practice items and the quiz questions were written by Ganzaa.