How to Convert Decimal to Hexadecimal
Converting decimal (base 10) to hexadecimal (base 16) uses the division-remainder method. This guide shows you exactly how.
The Division Method
- Divide the decimal number by 16
- Record the remainder (0-9 or A-F)
- Take the quotient and divide by 16 again
- Repeat until the quotient is 0
- Read the remainders from bottom to top — that's your hex number
Step-by-Step Examples
Example 1: Convert decimal 255 to hex
255 ÷ 16 = 15 remainder 15 → F
15 ÷ 16 = 0 remainder 15 → F
Result: FF
Example 2: Convert decimal 1000 to hex
1000 ÷ 16 = 62 remainder 8
62 ÷ 16 = 3 remainder 14 → E
3 ÷ 16 = 0 remainder 3
Result: 3E8
Example 3: Convert decimal 65535 to hex
65535 ÷ 16 = 4095 remainder 15 → F
4095 ÷ 16 = 255 remainder 15 → F
255 ÷ 16 = 15 remainder 15 → F
15 ÷ 16 = 0 remainder 15 → F
Result: FFFF
Quick Reference: Remainder to Hex Digit
| Remainder | Hex Digit | Remainder | Hex Digit |
|---|---|---|---|
| 0 | 0 | 8 | 8 |
| 1 | 1 | 9 | 9 |
| 2 | 2 | 10 | A |
| 3 | 3 | 11 | B |
| 4 | 4 | 12 | C |
| 5 | 5 | 13 | D |
| 6 | 6 | 14 | E |
| 7 | 7 | 15 | F |