How to Convert Decimal to Hex
Use repeated division by 16:
- Divide the decimal number by 16
- Record the remainder (0โ15, where 10โ15 map to AโF)
- Divide the quotient by 16 again
- Repeat until quotient is 0
- Read remainders bottom-to-top
Example: 255โโ to hex
255 รท 16 = 15 remainder 15 (F)
15 รท 16 = 0 remainder 15 (F)
Read remainders bottom-up: FF