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

  1. Choose the base to convert from (decimal) and to (hexadecimal); for hex to decimal, swap the two.
  2. Type or paste your numbers, one per line.
  3. Optionally, group the digits by 4 or 8 and add the 0x prefix.
  4. Click Convert, then copy the output — or reuse it as input for another conversion.

Decimal to hex table

DecimalHexDecimalHex
0–90–910064
10A12880
11B255FF
12C256100
13D10003E8
14E4095FFF
15F65535FFFF
161016777215FFFFFF

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:

  1. 330 ÷ 16 = 20, remainder 10 → A
  2. 20 ÷ 16 = 1, remainder 4
  3. 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

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.