Hex to Decimal Converter

16

Digits 0–9 and A–F; a 0x prefix, spaces and underscores are ignored. Calculated exactly in your browser.

Decimal result
2,026 10
Exact BigInt math, with steps

Enter a hexadecimal number to get its decimal value and the multiplication by powers of 16 that produces it.

How hex to decimal works

Hexadecimal is base 16. Each position is worth 16 times the position to its right, and the digits A–F stand for 10–15. To convert, multiply every digit by 16 raised to its position (rightmost is position 0) and add the products.

HexExpansionDecimal
FF15 × 16 + 15 × 1255
7EA7 × 256 + 14 × 16 + 10 × 12,026
1F41 × 256 + 15 × 16 + 4 × 1500
DEADBEEFsum of 8 digits × 16⁷ … 16⁰3,735,928,559

Digit values

0–9 keep their usual value; A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Upper- and lowercase are equivalent, and prefixes such as 0x (C, JavaScript, Python) only label the base.

Values are converted with arbitrary-precision integers, so 64-bit and larger values such as 7FFFFFFFFFFFFFFF (9,223,372,036,854,775,807, the largest signed 64-bit integer) stay exact. To read a hex value as a signed two's complement number instead, use the signed binary converter after converting hex to binary.

Related guides

FAQ

Frequently Asked Questions

How do you convert hex to decimal?
Multiply each hex digit by 16 raised to its position (counting from 0 on the right) and add the results. A=10, B=11, C=12, D=13, E=14, F=15. Example: 2F = 2 × 16 + 15 × 1 = 47.
What is FF in decimal?
FF = 15 × 16 + 15 = 255, the largest value that fits in one byte.
Does the 0x prefix change the value?
No. 0x only marks a number as hexadecimal in languages such as C, Python and JavaScript; 0x1F and 1F are both 31.
Copied to clipboard!