Hex to decimal converter (and decimal to hex)

Type a number in either field and the other converts as you type — hex to decimal or decimal to hex. The breakdown below shows the actual math for your number, not a canned example. Prefixes like 0x, spaces and underscores are fine.

Try:

Step by step

Type a number above to see the conversion worked out step by step.

How hex to decimal conversion works

Hexadecimal is base 16: each digit position is worth a power of 16, and the letters A–F stand for the values 10–15. To convert to decimal, multiply each digit by its positional value and add everything up:

1A3₁₆ = 1×16² + A(10)×16¹ + 3×16⁰ = 256 + 160 + 3 = 419₁₀

Going the other way — decimal to hex — divide repeatedly by 16 and read the remainders from bottom to top. The converter above shows both directions on whatever number you give it.

Hex digit reference

Hexadecimal digits and their decimal and binary values
HexDecimalBinary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111

Common hex values

Powers of two and "all ones" masks come up constantly. These are the ones worth recognizing on sight:

HexDecimalBinary
0x7F1270111 1111
0x801281000 0000
0xFF2551111 1111
0x1002560001 0000 0000
0x3FF1 0230011 1111 1111
0x4001 0240100 0000 0000
0xFFF4 0951111 1111 1111
0x10004 0960001 0000 0000 0000
0x7FFF32 7670111 1111 1111 1111
0xFFFF65 5351111 1111 1111 1111
0x1000065 5360001 0000 0000 0000 0000
0x7FFFFFFF2 147 483 6470111 1111 1111 1111 1111 1111 1111 1111
0xFFFFFFFF4 294 967 2951111 1111 1111 1111 1111 1111 1111 1111

See the full 0x00–0xFF table

Where you'll meet hex numbers

Memory addresses (0x7FFF5FBFF8C0), color codes (#FFA700), byte dumps, permission masks, MAC addresses, error codes — hexadecimal shows up anywhere data is described byte by byte, because two hex digits are exactly one byte.

Related tools and guides