Skip to content
Hexadecimal Converter

Hex to Decimal Converter

To convert hex to decimal, multiply each digit by 16 raised to its position, counting from 0 at the right, and add the results. Letters A–F stand for 10–15. For example, 2AF3 is 2×4096 + 10×256 + 15×16 + 3 = 10995. The converter does this exactly for values of any length.

Bit width

Method: Sum of powers of 16
Each hex digit times its power of 16
DigitValueWeightProduct
22× 1638192
A10× 1622560
F15× 161240
33× 1603

Add the products: 10 995.

How to convert hex to decimal by hand

A hex numeral is a polynomial in 16. Converting hexadecimal to decimal is just evaluating that polynomial, which you can do on paper with nothing harder than multiplication by a few fixed weights.

  1. Write the hex number and number its digits from the right, starting at 0.
  2. Replace each letter with its value: A is 10, B 11, C 12, D 13, E 14, F 15.
  3. Multiply each digit by 16 raised to its position number.
  4. Add the products; the total is the decimal value.

If you prefer fewer large numbers, there is an equivalent running form: start with the leftmost digit, then for each next digit multiply what you have by 16 and add the digit. For 2AF3 that is 2, then 2 × 16 + 10 = 42, then 42 × 16 + 15 = 687, then 687 × 16 + 3 = 10995. It is the same arithmetic grouped differently, and it is how most parsers do it.

Worked example: 2AF3

Four digits, so the weights run from 16³ down to 16⁰

2AF316 = 10 99510

Each hex digit times its power of 16
DigitValueWeightProduct
22× 1638192
A10× 1622560
F15× 161240
33× 1603

Add the products: 10 995.

Powers of 16 worth remembering

Every hex place is worth sixteen of the place to its right. Knowing the first few weights by sight makes a mental estimate quick: a five-digit hex number is somewhere between 65,536 and about a million, and an eight-digit one never exceeds 4,294,967,295.

The weight of each place is also a power of two, four times the position: 16³ is 2¹², which is why 1000 in hex marks a 4 KiB boundary in memory maps and page tables.

Place values in hexadecimal
PowerHexDecimal
16011
1611016
162100256
16310004096
1641000065 536
1651000001 048 576
166100000016 777 216
16710000000268 435 456
1681000000004 294 967 296

When the same hex means a negative number

The sum of powers gives the unsigned value. A program that stores the bits in a signed 32-bit integer reads the top bit as −2³¹ instead of +2³¹, so patterns from 80000000 up wrap around to negative numbers. 7FFFFFFF is the last positive value; one step past it the sign flips.

To read a value the way a signed type does, pick its width in the converter. The decimal row then shows the signed reading, with the unsigned one underneath. A value from a debugger that looks absurdly large, like 4294967286, is often just −10 seen without a width.

Two 32-bit patterns, read both ways
HexUnsignedSigned 32-bit
7FFFFFFF2 147 483 6472 147 483 647
800000002 147 483 648−2 147 483 648
FFFFFFF64 294 967 286−10
FFFFFFFF4 294 967 295−1

Questions people ask

What is FFFFFFFF in decimal?

4294967295 as an unsigned number, which is 2³² − 1. Read as a signed 32-bit integer in two’s complement, the same bits mean −1.

What is 7FFFFFFF in decimal?

2147483647, which is 2³¹ − 1, the largest signed 32-bit integer (INT32_MAX in C). One more, 80000000, reads as −2147483648 when treated as signed 32-bit.

What is 12 hex in decimal?

18. The 1 sits in the sixteens place and the 2 in the ones place, so 1 × 16 + 2 = 18.

What is 100 hex in decimal?

256, because 100 in hex is 1 × 16² = 256. It is one more than FF (255), the largest value of a byte.

How do I convert a hex fraction like 1A.8 to decimal?

Digits after the point use negative powers of 16. In 1A.8 the 8 is worth 8 × 16⁻¹ = 0.5, so 1A.8 = 1 × 16 + 10 + 0.5 = 26.5.

Last updated