Decimal to Hex Converter With Steps
Enter a decimal number to see it in hex, with the working.
How it works
Divide the number by 16 and note the remainder. Divide the result by 16 again, and repeat until you reach 0. Turn any remainder from 10 to 15 into its letter, A to F. Reading the remainders from last to first gives the hex number.
A common everyday use is colour. Screen colours are three numbers from 0 to 255 for red, green and blue. Each one becomes two hex digits, which is where codes such as #FF8800 come from: 255 red, 136 green, 0 blue.
If you already have the number in binary, it is faster to group the bits in fours than to divide.
Worked example
419: 419 ÷ 16 = 26 remainder 3. 26 ÷ 16 = 1 remainder 10, which is A. 1 ÷ 16 = 0 remainder 1. Read upward: 1A3.
Decimal, binary, octal and hex from 0 to 15
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 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 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Common questions
What is 255 in hex?
FF.
What is 100 in hex?
64. That is 6 times 16, which is 96, plus 4.