Units
Converter Units

Hex to Decimal: Hexadecimal Base 16 Converter

With the place-value working shown, not just the answer, because most people looking this up are trying to learn the method.

0xFF
255
binary 11111111
0x100
256
binary 100000000
0x1F
31
binary 11111
0x7F
127
binary 1111111
0x20
32
binary 100000
0x0A
10
binary 1010
0xFFF
4,095
binary 111111111111
0xFFFF
65,535
binary 1111111111111111
0x2A
42
binary 101010
Decimal  
 
Show the working
 

How the conversion works

Every positional number system works the same way. Each digit is multiplied by the base raised to the power of its position, counting from zero at the right, and the results are added.

0x1F  =  1 × 161  +  15 × 160
        =  16 + 15  =  31

The letters A through F stand for 10 through 15, which is the only part of hex that isn't immediately obvious. Expand the working panel above and the tool shows this expansion for whatever you type.

Reference table

HexDecimalBinaryOctal
0x0000
0x1111
0x88100010
0x99100111
0xA10101012
0xB11101113
0xC12110014
0xD13110115
0xE14111016
0xF15111117
0x10161000020
0x1F311111137
0x203210000040
0x7F1271111111177
0x8012810000000200
0xFF25511111111377
0x100256100000000400
0xFFF4,0951111111111117777
0xFFFF65,5351111111111111111177777

Where hex turns up

Color codes are the most common encounter. A CSS color such as #1B5B43 is three bytes, one each for red, green and blue, written as two hex digits apiece.

Beyond that: memory addresses, MAC addresses, file signatures, character encodings and permission masks. The reason is always the same, that one hex digit is exactly four bits, so hex writes binary compactly without breaking byte alignment.

Common questions

How do I convert hex to decimal?

Multiply each hex digit by 16 raised to the power of its position, counting from zero at the right, then add the results. For 1F: F is 15 times 16 to the power 0, which is 15. The 1 is 1 times 16 to the power 1, which is 16. 15 plus 16 is 31.

What is FFFFFFFF in decimal?

4,294,967,295. That is the largest value a 32-bit unsigned integer can hold, which is why it turns up so often.

What is 12 hex in decimal?

0x12 is 18 in decimal. The 1 contributes 16 and the 2 contributes 2.

Why does computing use hexadecimal at all?

Because one hex digit maps exactly to four binary digits, so a byte is always exactly two hex digits. That makes hex a compact way to write binary without losing the alignment.

Related converters and guides

Sources

About the author

Written and last reviewed August 2026 by Cedrick Reese. Conversion logic rechecked against the sources listed above on that date.

More about who builds these tools, how the numbers are sourced, and how to report an error: About Converter Units.