The Util Box

Decimal to Hex

Free online decimal to hex. Convert base-10 to base-16. Perfect for designers and developers.

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/decimal-to-hex" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free Decimal to Hex tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/decimal-to-hex -->
<a href="https://www.theutilbox.org/tools/decimal-to-hex">Decimal to Hex by The Util Box</a>

Frequently Asked Questions about Decimal to Hex

Decimal to Hex Converter — With the Working Shown

This decimal to hex converter turns a decimal number into hexadecimal, and also shows the 32-bit binary form beside it. Underneath both sits a step-by-step panel that walks through the conversion by repeated division, so you can see exactly how the digits are produced rather than just being handed the answer.

The binary is grouped into sets of four bits, which makes it far easier to read than an unbroken run of 32 digits.

How the Conversion Works

For a positive number, the tool divides by 16 repeatedly, recording the remainder at each step, and then reads those remainders from last to first. Each remainder from 10 upwards is written as the corresponding letter: 10 becomes A, 11 becomes B, and so on up to 15 and F.

Negative numbers are handled using two's complement, which is how a 32-bit processor actually stores them. The tool converts the absolute value to binary, pads it to 32 bits, inverts every bit, and adds one. The steps panel explains this rather than showing the intermediate inverted bits.

Output Format and Limits

  • The hex is always eight digits with a 0x prefix, zero-padded to the full 32-bit width, and in uppercase. Leading zeroes are what make it a address rather than a number.
  • Decimals are truncated, because the input is read as an integer. Entering 255.9 gives 0x000000FF.
  • The binary is the two's-complement form for negative numbers, so a negative value starts with a 1 bit rather than a minus sign. It is not a sign-magnitude representation.
  • Values outside the signed 32-bit range wrap. The input's minimum and maximum attributes suggest −2,147,483,648 to 4,294,967,295, but they are not enforced, so a number beyond that is silently converted to its wrapped equivalent.
  • The step-by-step panel is only generated for positive numbers in full detail. For a negative value it summarises the two's-complement steps instead of showing each division.

Related Converters

The conversion runs entirely in your browser and works offline.