Versión en español →

Number systems · Free · No sign-up

Hexadecimal to decimal converter with steps

Type a hex number, press Convert and get its decimal value with every multiplication by the powers of 16 explained step by step. It accepts lowercase letters, the 0x prefix, negative numbers and fractional parts.

Convert hex to decimal

Lowercase letters and a 0x prefix are fine
Hex letters
Quick keys
Examples: FF 2BC 1A3F FFFF 12C.A8 −2BC
AD SPACE

How do you read a hexadecimal number?

A hexadecimal number is written with 16 digits: 0 to 9 plus the letters A to F, which stand for 10 to 15. To work out its decimal value you need two things: the value of each digit and the place it sits in.

In decimal, the rightmost digit is the ones, the next one the tens, then the hundreds. Hexadecimal works the same way, except that every place to the left is worth 16 times more than the one before. Each place is called a position, and positions are counted from the right starting at 0:

PositionPowerPlace value
0 (rightmost)16⁰1
116¹16
216²256
316³4096
416⁴65536

For example, in 2BC the 2 is in position 2 and is worth 2 · 256; the B, in position 1, is worth 11 · 16; and the C, in position 0, is worth 12 · 1. Add those three amounts and you have the number in decimal.

Hex to decimal chart from 0 to F

These are the 16 hex digits and what each one is worth in decimal. You’ll need it to swap every letter for its number before multiplying:

HexadecimalDecimal
00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15

↓ Scroll inside the chart to see down to F

Tip: A is 10 and each letter after it is one more, up to F, which is 15. If you mix up one in the middle, count back from F = 15.

How to convert hexadecimal to decimal in 3 steps

The method is the sum of powers of 16 (some textbooks call it the expanded form or positional notation method). It’s the same reasoning you use without thinking every time you read a decimal number:

Step 1 · Number the positions from right to left

Under each digit write its position, starting with 0 under the rightmost digit and adding one as you move left. In 2BC: C is position 0, B is position 1 and 2 is position 2.

Step 2 · Replace the letters with their values

Using the chart above: A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. The digits 0 to 9 stay as they are.

Step 3 · Multiply each digit by 16 to the power of its position and add

Multiply every digit by the power of 16 for its position (1, 16, 256, 4096…) and add up all the results. The total is the number in decimal.

If the number has a fractional part

Digits to the right of the hexadecimal point are worked out the same way, but their positions are negative: the first one after the point is −1, the next −2, and so on. Raising 16 to a negative position is the same as dividing:

PositionPowerPlace value
−116⁻¹ = 1/160.0625
−216⁻² = 1/2560.00390625
−316⁻³ = 1/40960.000244140625

Unlike converting decimal to hexadecimal, in this direction the result is always exact: you never get digits that repeat forever.

Worked example: 2BC to decimal step by step

Let’s convert 2BC to decimal. We number the positions from the right, swap the letters for their values and multiply each digit by its power of 16:

DigitValuePositionCalculationResult
2222 · 16² = 2 · 256512
B11111 · 16¹ = 11 · 16176
C12012 · 16⁰ = 12 · 112

Now add up the results (in blue): 512 + 176 + 12 = 700

Result: 2BC₁₆ = 700₁₀. To check it the other way round, type 700 into the decimal to hexadecimal converter and you’ll get 2BC.

Another example with a fractional part: 12C.A8

The part to the left of the point (12C) and the part to the right (A8) are worked out the same way. The only difference is that the digits after the point have negative positions:

DigitValuePositionCalculationResult
1121 · 16² = 1 · 256256
2212 · 16¹ = 2 · 1632
C12012 · 16⁰ = 12 · 112
A10−110 · 16⁻¹ = 10 · 0.06250.625
88−28 · 16⁻² = 8 · 0.003906250.03125

Add up the results: 256 + 32 + 12 + 0.625 + 0.03125 = 300.65625

Result: 12C.A8₁₆ = 300.65625₁₀. You can check both examples by typing them into the converter.

Common mistakes when converting hex to decimal

  • Counting positions from the left. Always count from the right. Do it the other way round and 2BC gives you 2 · 1 + 11 · 16 + 12 · 256 = 3250 instead of 700.
  • Starting the count at 1. The rightmost digit is in position 0 (16⁰ = 1). Start at 1 and everything comes out multiplied by 16: 2BC would give 11200.
  • Multiplying the letter without converting it. Before multiplying, turn each letter into its number: B is 11, not 1 or 2.
  • Using positive positions after the point. To the right of the point the positions are −1, −2…: you divide by 16, you don’t multiply.

Frequently asked questions

What is FF in decimal?

FF in decimal is 255: 15 · 16 + 15 · 1 = 240 + 15. It’s the largest value that fits in a byte, which is why each color channel on a web page goes from 00 to FF.

What is the largest number you can write with N hex digits?

With N digits, the maximum is 16 to the power of N, minus 1. That is: F = 15, FF = 255, FFF = 4095, FFFF = 65535 and FFFFFFFF = 4294967295.

Can I type the number with 0x or in lowercase?

Yes. The converter reads 0x2BC, 2bc, 2BCh and 2BC the same way. They’re just different ways of saying the number is in base 16.

Why is the fractional part always exact when converting hex to decimal?

Because every position after the point means dividing by 16, and dividing by 16 always terminates (0.0625, 0.00390625…). So the decimal result never has digits that repeat forever, unlike when you convert decimal to hexadecimal.

How do I know if a hex number is negative?

If it has a minus sign in front, just convert it and put the sign on the result. But computers usually store negatives in two’s complement: if the number is 2, 4 or 8 digits long and starts with 8, 9 or a letter, it may stand for a negative value. The converter warns you when that happens and gives you both values.

Go up