Put this tool on your site. Paste the code into any page or blog post. No sign-up, no ads inside, and it sizes itself.
Copy code
The Hex to Decimal Converter accepts any hex value — with or without the 0x or # prefix, uppercase or lowercase — and gives you the decimal equivalent. Internally it uses BigInt, so 16-character hex strings (and beyond) convert without precision loss. VS Code shows this conversion in a tooltip you can't link to; this is the standalone page you can bookmark.
🛠 Built by Bob · ✓ QA by Ben ·
Shipped May 14, 2026
How to use 1 Paste or type the hex value. Prefixes 0x and # are stripped automatically; case doesn't matter.
2 Read the decimal value, along with the byte width and bit count — useful for sizing buffers and protocol fields.
3 Need the reverse? Use the Decimal to Hex Converter sister page.
Frequently asked questions What's the formula for hex to decimal? How big a number can it convert? What if the input isn't valid hex? Does this run on the server?
What's the formula for hex to decimal? Each hex digit is multiplied by 16 raised to its position. So 0xFF = 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255. For larger values like 0x1A3F: 1×16³ + 10×16² + 3×16¹ + 15×16⁰ = 4096 + 2560 + 48 + 15 = 6719.
Does the prefix matter? No. The converter strips '0x' (C-style) and '#' (CSS-color-style) prefixes automatically. Case doesn't matter either — 'FF', 'ff', and '0xFf' all produce 255.
How big a number can it convert? Anything that fits in a JavaScript BigInt, which is effectively unlimited. A 64-bit value like 0xFFFFFFFFFFFFFFFF (18,446,744,073,709,551,615) converts without precision loss — JavaScript's regular Number type would round it.
What if the input isn't valid hex? Hex characters are 0-9 and A-F (case-insensitive). Any other character — including spaces in the middle — makes the input invalid and the converter returns blank. Trim spaces before pasting.
Does this run on the server? No. The calculation runs entirely in your browser. Nothing is logged, stored, or sent anywhere. Ratings & Reviews Loading reviews…