Decimal to Hex Converter
Free online decimal to hexadecimal converter. Instantly convert decimal numbers to hex with examples and conversion table.
Convert Decimal to Hexadecimal
Enter a decimal (base 10) number and instantly get its hexadecimal (base 16) equivalent. The converter also works in reverse — enter hex to get decimal. Both uppercase and lowercase hex input is accepted.
How to convert decimal to hexadecimal
Repeatedly divide the decimal number by 16, recording the remainder each time. The remainders in reverse order give the hexadecimal digits. Remainders 10–15 are written as the letters A–F.
For example, to convert 255 to hex: 255 ÷ 16 = 15 remainder 15 (F), 15 ÷ 16 = 0 remainder 15 (F). Reading remainders in reverse: FF.
Hexadecimal digits
| Decimal | Hex | Decimal | Hex |
|---|---|---|---|
| 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 |
Decimal to hexadecimal conversion table
| Decimal | Hexadecimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
| 16 | 10 |
| 32 | 20 |
| 64 | 40 |
| 128 | 80 |
| 255 | FF |
| 256 | 100 |
| 512 | 200 |
| 1024 | 400 |
| 4096 | 1000 |
| 65535 | FFFF |
Where is hexadecimal used?
Colors in CSS/HTML: Colors are written as hex codes like #FF5733 or #0000FF.
Memory addresses: Programmers and debuggers display memory addresses in hex.
Binary data: Hex is a compact way to represent binary data — each hex digit represents exactly 4 bits.
Unicode and ASCII: Character codes are often expressed in hexadecimal.