Decimal to hex converter
Any decimal number to hexadecimal, exactly — plus binary and octal.
| Binary | 1000000000000 | |
| Octal | 10000 | |
| Decimal | 4096 | |
| Hexadecimal | 1000 |
Convert decimal numbers to hexadecimal
Type a decimal number and get its hexadecimal form, with binary and octal alongside. Large values are exact, so database IDs, timestamps in microseconds and 64-bit values convert without rounding.
Doing it by hand
Divide by 16 repeatedly and note each remainder, writing 10–15 as A–F. The remainders read from last to first are the hex number. For 500: 500 ÷ 16 = 31 remainder 4; 31 ÷ 16 = 1 remainder 15 (F); 1 ÷ 16 = 0 remainder 1. Reading upwards: 1F4.
Some values worth recognising: 255 is ff, 256 is 100, 4096 is 1000, 65535 is ffff. In code, hex literals are usually written with a 0x prefix, in CSS with #.
Other conversions with this tool
How to convert decimal to hex
- 1
Type a decimal number.
- 2
Read the hexadecimal value in the table.
- 3
Copy any result with one click.
Decimal to Hex — frequently asked questions
How do you convert decimal to hex by hand?
Divide by 16 repeatedly, write down the remainders as hex digits (10–15 become A–F), then read them from last to first. 300 → 18 r12 (C) → 1 r2 → 0 r1 gives 12C.
Is the output upper- or lowercase?
Lowercase, which is what most programming languages print. Hex is case-insensitive, so either form means the same number.
Does it handle very large numbers?
Yes. BigInt keeps the conversion exact for integers of any size.