gettoolz.app

Hex to decimal converter

Convert hex numbers to decimal — by adding up each digit times its power of 16. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.

Part of developer tools.

Base

Binary

10101101

Octal

255

Decimal

173

Hexadecimal

AD

Hex to decimal table

HexDecimal
00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15
1016
64100
7F127
FF255
100256
3E81000
4001024
10004096
FFFF65535
FFFFFFFF4294967295
FFFFFFFFFFFFFFFF18446744073709551615

The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.

How to convert hex to decimal

Multiply each hex digit by the power of 16 for its position — 16⁰ = 1 for the rightmost digit, 16¹ = 16 for the next, 16² = 256 after that — and add the results. The letters count as 10 to 15: A is 10, F is 15. For AD: A (10) × 16¹ + D (13) × 16⁰ = 160 + 13 = 173.

Hex and decimal side by side

The largest 16-bit value is FFFF in hex and 65535 in decimal: 4 digits against 5. A decimal digit is worth log₂ 10 ≈ 3.32 bits, against 4 for a hex digit — not a whole ratio, so decimal and hex digits never line up and there is no digit-by-digit shortcut: the whole number has to be added up, as above. Hex is the usual way to write bytes — colours like #FF8800, memory addresses, hashes, escape sequences — because a byte is always exactly two hex digits. In JavaScript and Python source, 173 is written 0xAD in hex and 173 with no prefix in decimal. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — hex on this page.

Other conversions

Going the other way? Decimal to hex converter.

Or open the full number base converter and see a number in all four bases at once.