How to use the Decimal to Hex Converter
Type a whole number in decimal. You get the hex value, plus binary and octal.
How decimal to hex conversion works
Divide the number by 16 and note the remainder, then divide the quotient by 16 again until it reaches 0. Remainders from 10 to 15 are written A to F. Read the remainders from last to first. For 500: 500 ÷ 16 = 31 remainder 4, 31 ÷ 16 = 1 remainder 15 (F), and 1 ÷ 16 = 0 remainder 1, so 500 is 1F4.
Hex and colour codes
Web colours use one hex pair for each of red, green and blue. A channel value of 255 is FF, 128 is 80 and 0 is 00, so rgb(255, 128, 0) is written #FF8000.
How it works
Divide repeatedly by 16 and read the remainders upward.
Examples
- 500
Hex: 1F4 Binary: 1 1111 0100 Octal: 764
- 255
Hex: FF Binary: 1111 1111 Octal: 377
- 4096
Hex: 1000 Binary: 1 0000 0000 0000 Octal: 10000
Decimal to hex table
| Decimal | Hex |
|---|---|
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
| 16 | 10 |
| 32 | 20 |
| 64 | 40 |
| 100 | 64 |
| 127 | 7F |
| 128 | 80 |
| 255 | FF |
| 256 | 100 |
| 500 | 1F4 |
| 1000 | 3E8 |
| 4096 | 1000 |
| 65535 | FFFF |
Limitations and assumptions
Runs entirely in your browser. Nothing you enter is uploaded.
Frequently asked questions
What is 255 in hex?
FF, the largest two-digit hex value and the maximum of one byte.
What is 16 in hex?
10. In base 16 the digit after F rolls over to the next place, just as 9 rolls over to 10 in decimal.
What do the letters A to F mean?
They are single digits for the values 10 to 15, because base 16 needs sixteen symbols and decimal only has ten.
How do I convert hex back to decimal?
Use the hex to decimal converter, or multiply each digit by its power of 16 and add the results.