Decimal to Hex Converter
Enter a decimal number to get its hexadecimal form, with each division by sixteen shown.
1011 1110 1110 111113735748,879BEEFWorking
| Divide | Quotient | Remainder |
|---|---|---|
| 48879 ÷ 16 | 3054 | F |
| 3054 ÷ 16 | 190 | E |
| 190 ÷ 16 | 11 | E |
| 11 ÷ 16 | 0 | B |
The method
Divide by 16 and keep the remainder, writing 10–15 as A–F. Repeat with the quotient until it is 0, then read the remainders upwards.
Place value: the idea behind every base
In any base, a digit’s worth depends on its column. Each column is worth the base times the column to its right. Tap a digit to change it and watch the total.
1×1,048,576 + 1×4,096 + 1×256 + 1×1 = 1,052,929 in decimal
Decimal is the same system with ten digits: 347 is 3×100 + 4×10 + 7×1. Nothing about base 10 is special apart from our ten fingers.
Decimal to hex table
| Decimal | Hex |
|---|---|
| 10 | A |
| 15 | F |
| 16 | 10 |
| 32 | 20 |
| 64 | 40 |
| 100 | 64 |
| 127 | 7F |
| 128 | 80 |
| 200 | C8 |
| 255 | FF |
| 256 | 100 |
| 1000 | 3E8 |
| 4096 | 1000 |
| 65535 | FFFF |
| 1000000 | F4240 |
| 16777215 | FFFFFF |
Questions people ask
How do I convert decimal to hex?
Divide by 16, record the remainder as a hex digit (10 = A … 15 = F), and repeat with the quotient. 254 → 15 r14 (E) → 0 r15 (F), so 254 = FE.
What is 255 in hex?
FF. And 256 is 100, the same way 99 + 1 rolls over to 100 in decimal.
How do I turn an RGB colour into hex?
Convert each channel (0–255) to two hex digits and join them: rgb(255, 136, 0) → FF, 88, 00 → #FF8800.