Decimal ↔ Hex Converter
Convert numbers between decimal and hexadecimal — or binary, octal and base 36 — one number or a whole list at once.
● Your data is processed locally in your browser and is never uploaded to our servers.
How to use the converter
- Choose the base to convert from (decimal) and to (hexadecimal); for hex to decimal, swap the two.
- Type or paste your numbers, one per line.
- Optionally, group the digits by 4 or 8 and add the
0xprefix. - Click Convert, then copy the output — or reuse it as input for another conversion.
Decimal to hex table
| Decimal | Hex | Decimal | Hex |
|---|---|---|---|
| 0–9 | 0–9 | 100 | 64 |
| 10 | A | 128 | 80 |
| 11 | B | 255 | FF |
| 12 | C | 256 | 100 |
| 13 | D | 1000 | 3E8 |
| 14 | E | 4095 | FFF |
| 15 | F | 65535 | FFFF |
| 16 | 10 | 16777215 | FFFFFF |
How to convert decimal to hex by hand
Divide by 16 repeatedly and write down the remainders, then read them from bottom to top. Remainders 10–15 become A–F. Example with 330:
- 330 ÷ 16 = 20, remainder 10 → A
- 20 ÷ 16 = 1, remainder 4
- 1 ÷ 16 = 0, remainder 1
Read upwards: 330 = 14A in hex.
Hex to decimal
Multiply each digit by a power of 16, from right to left (1, 16, 256, 4096…) and add. Example: 3E8 = 3 × 256 + 14 × 16 + 8 × 1 = 768 + 224 + 8 = 1000.
Where hex is used
- Colors:
#FF8000is red 255, green 128, blue 0. Convert colors with the HEX to RGB converter. - Bytes: one byte (0–255) is exactly two hex digits (00–FF), which is why hex is used for memory addresses, hashes and file dumps.
- Unicode: characters are written as U+00E9 (é).
In code and spreadsheets
Excel / Google Sheets: =DEC2HEX(255) and =HEX2DEC("FF"). Python: hex(255) → '0xff', format(255, 'X') → 'FF', int('FF', 16) → 255. JavaScript: (255).toString(16) and parseInt('FF', 16).
FAQ
What is hexadecimal?
Base 16: it uses the digits 0–9 and the letters A–F for 10 to 15. Each hex digit represents exactly 4 bits.
Does 0x mean anything?
It's just a prefix telling programmers the number is hex: 0x1F = 31. Likewise 0b is binary and 0o is octal.
How do I convert to binary?
Choose Binary as the target base here, or use the Decimal to Binary Converter. To turn text into hex, use the Hex Encoder.