How to use the Decimal to Hex Converter
- Type or paste the decimal number into the first box.
- Read the hex result in the second box, and click Copy to copy it.
- Scroll to How it works for the step-by-step method.
How to convert decimal to hex
Divide the number by 16 and write down the remainder, using A–F for remainders 10 to 15. Keep dividing until you reach 0, then read the remainders from the bottom up.
Example: 255 ÷ 16 = 15 r 15 (F), 15 ÷ 16 = 0 r 15 (F), so 255 = FF. 1000 = 3E8.
For colors, convert each of red, green and blue (0–255) to two hex digits: rgb(255, 128, 0) is #FF8000.
Reference table
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
Frequently asked questions
What is 100 in hex?
64. 6 × 16 + 4 = 100.
How do I write a negative number in hex?
Tick Signed (two's complement) and pick a bit width: −1 in 32 bits is FFFFFFFF.