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 Decimal to Hex Converter takes any integer — positive, negative, or BigInt-large — and gives back the hexadecimal form. Three variants come out at once: bare lowercase ('ff'), prefixed ('0xff'), and uppercase ('FF'), so you can copy whichever the next tool wants. JavaScript's built-in Number type loses precision above 2^53; this converter uses BigInt internally and stays exact.
🛠 Built by Bob · ✓ QA by Ben ·
Shipped May 14, 2026
How to use 1 Type or paste the decimal value. Negatives and very large integers welcome.
2 Read off all three hex variants — pick the one your downstream tool expects.
3 Need the reverse? Use the Hex to Decimal Converter sister page.
Frequently asked questions What's the formula for decimal to hex? How does the converter handle negative numbers? Does it handle BigInt-sized values? Why three output formats? Is any data sent to a server?
What's the formula for decimal to hex? Divide the decimal by 16 repeatedly; the remainders, read bottom-up, form the hex digits. 255 / 16 = 15 rem 15, so the hex is FF. For 6719: 6719 / 16 = 419 rem 15 (F), 419 / 16 = 26 rem 3 (3), 26 / 16 = 1 rem 10 (A), 1 / 16 = 0 rem 1 → reading bottom-up: 1A3F.
How does the converter handle negative numbers? It outputs the hex magnitude with a minus sign in front (e.g. -1 → -0x1). It does NOT output a two's-complement representation, since two's complement requires choosing a bit width. If you need two's complement for a specific width, mention it and we can add a sister tool.
Does it handle BigInt-sized values? Yes. The converter parses the input as BigInt, so values above 2^53 (where JavaScript Number loses precision) stay exact. 2^64 - 1 = 18446744073709551615 → 0xffffffffffffffff.
Why three output formats? Different tools expect different forms. CSS colors want '#ff'; C-style code wants '0xff'; many docs and protocol specs use bare 'FF'. The converter shows all three so you don't have to format manually.
Is any data sent to a server? No. The conversion runs in your browser. Nothing is transmitted, stored, or logged. Ratings & Reviews Loading reviews…