Hex to Decimal

Paste hex, get decimal — with the signed and unsigned readings shown separately, because FFFFFFFF is both 4,294,967,295 and −1 depending on the width it came from.

Runs 100% in your browserNothing is uploaded to a serverFree forever

Hexadecimal

Decimal

Copied!

How hex becomes decimal

Hexadecimal is base 16, so each column is worth sixteen times the one to its right: 1, 16, 256, 4096, and so on. The digits run 0–9 then A–F, where A is ten and F is fifteen. To convert by hand you multiply each digit by its column value and add: 2F is (2 × 16) + 15 = 47, and 1A2B is (1 × 4096) + (10 × 256) + (2 × 16) + 11 = 6699. The converter above does the same arithmetic in BigInt, so it keeps working at lengths where doing it by hand stops being reasonable.

Most hex you meet in a day is a byte or a small run of them. A colour like #3CE688 is three bytes — red 60, green 230, blue 136. A permissions value, a status register, an opcode and a memory offset are all the same idea at different widths. The table below is the whole first byte, which covers the majority of hand conversions in one glance.

Every byte, 00 to FF, in decimal
 0123456789ABCDEF
0_0123456789101112131415
1_16171819202122232425262728293031
2_32333435363738394041424344454647
3_48495051525354555657585960616263
4_64656667686970717273747576777879
5_80818283848586878889909192939495
6_96979899100101102103104105106107108109110111
7_112113114115116117118119120121122123124125126127
8_128129130131132133134135136137138139140141142143
9_144145146147148149150151152153154155156157158159
A_160161162163164165166167168169170171172173174175
B_176177178179180181182183184185186187188189190191
C_192193194195196197198199200201202203204205206207
D_208209210211212213214215216217218219220221222223
E_224225226227228229230231232233234235236237238239
F_240241242243244245246247248249250251252253254255

The case that trips people up

A hex value with the top bit set has two correct decimal answers, and which one you want depends on the type it came out of. FFFFFFFF is 4,294,967,295 read as unsigned and −1 read as a signed 32-bit integer. If the number came from a C int, a Java int, a Go int32 or a register dump, the signed reading is almost certainly the one you want. Set the width above and tick signed and you get both, side by side, rather than having to guess which convention the tool picked for you.

The same is true of a value like 80000000: unsigned it is 2,147,483,648, signed it is −2,147,483,648, and a converter that only ever prints one of them is wrong for half the people who paste it in.

Where you keep meeting hex

Memory addresses and pointer values in a debugger or a crash log; CSS and design-token colours; the error codes Windows prints as 0x80070005; file magic numbers such as the 89 50 4E 47 that starts every PNG; MAC addresses; and every hash digest you will ever compare. In every one of those cases the hex is the canonical form and the decimal is what you want for a moment, to check a range or a size.

Going the other way, or want a bit pattern instead of a decimal? Try decimal to hex, hex to binary, or the full base converter with all bases at once.

More developer tools