24 min read
Decimal to Binary, Octal and Hexadecimal
Divide by the new base again and again, write down each remainder, then read the remainders from the bottom up.
The Repeated Division Method
To turn a decimal number into another base:
- Divide the number by the new base (2, 8 or 16).
- Write down the whole-number answer (the quotient) and the remainder.
- Divide the quotient by the base again. Keep going until the quotient is 0.
- Read the remainders from the bottom to the top. That is your answer.
The first remainder you find is the ones digit (the right-hand end). That is why you read from the bottom up.
Decimal to Binary
Another Way: Subtract Powers of 2
Some students prefer this method for binary:
- Find the largest power of 2 that fits into the number. Put a 1 in that column.
- Subtract it. Repeat with what is left.
- Put 0 in every column you did not use.
For 45: 32 fits (45 − 32 = 13), 16 does not (0), 8 fits (13 − 8 = 5), 4 fits (5 − 4 = 1), 2 does not (0), 1 fits (1 − 1 = 0). So 45 = 101101₂. Both methods give the same answer — use the one you find easier, and show it clearly.
Decimal to Octal
Decimal to Hexadecimal
Divide by 16. Any remainder from 10 to 15 must be written as a letter (A–F).
Number base converter
Binary (2)
11101101
Octal (8)
355
Decimal (10)
237
Hex (16)
ED
Working: divide by 2 again and again
| Divide | Quotient | Remainder |
|---|---|---|
| 237 ÷ 2 | 118 | 1 |
| 118 ÷ 2 | 59 | 0 |
| 59 ÷ 2 | 29 | 1 |
| 29 ÷ 2 | 14 | 1 |
| 14 ÷ 2 | 7 | 0 |
| 7 ÷ 2 | 3 | 1 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Stop when the quotient is 0. Read the remainders from the bottom up ↑
Answer: 23710 = 111011012
Practice
More lessons in Number Systems · Next: Binary and Octal · Previous: Converting Any Base to Decimal
