Hex to Double Converter (IEEE 754 64-bit) – Free

This hex to double converter reads up to 16 hexadecimal digits as the bit pattern of an IEEE 754 binary64 value and prints the number it encodes, including Infinity, NaN and negative zero.

How to use the Hex to Double Converter tool

  1. Paste the pattern into Hexadecimal bits, most significant byte first. A 0x prefix and spaces between groups are allowed.
  2. Make sure all 16 digits are present, including trailing zeros.
  3. Select Convert. The Example button decodes C02A800000000000.
  4. Read the decimal value in the result panel and select Copy if you need it.

How hex to double decoding works

Sixteen hex digits are 64 bits. The first bit is the sign, the next 11 are the exponent field, and the last 52 are the fraction. For exponent fields from 1 to 2046, the value is 1.fraction x 2^(exponent - 1023), negated when the sign bit is set.

Two exponent fields are special. Zero marks a subnormal number, 0.fraction x 2^-1022, or a signed zero when the fraction is also zero. The field 7FF marks Infinity when the fraction is zero and NaN otherwise. The tool prints those cases as Infinity, -Infinity, NaN and -0.

Worked example: C02A800000000000

The leading digits C02 are 1100 0000 0010. The first bit, 1, makes the number negative. The remaining eleven bits are 402 hex, or 1026, and 1026 - 1023 = 3. The fraction starts A8, which is 1010 1000, so the significand is 1.10101 in binary, or 1.65625. Multiply by 2^3 and apply the sign: -13.25.

C02A800000000000  ->  -13.25
3FF0000000000000  ->  1
3FB999999999999A  ->  0.1
400921FB54442D18  ->  3.141592653589793
7FEFFFFFFFFFFFFF  ->  1.7976931348623157e+308
0000000000000001  ->  5e-324
7FF8000000000000  ->  NaN

Input rules and the mistakes they cause

Most wrong answers come from how the pattern was typed, not from the decoding.

  • Short input is padded with zeros on the left. C02A8 is read as 00000000000C02A8, a tiny subnormal, not -13.25.
  • Bytes must be in big-endian order. Reverse the bytes of a little-endian memory dump before pasting.
  • An 8-digit float pattern is not a double. C1540000 decodes to 1.6025057325e-314 here. Use the Hex to Float Converter for it.
  • Binary works with a 0b prefix and up to 64 digits.
  • A value that begins with 0b and continues with only 0s and 1s is treated as binary. Add 0x in front to force hex.
  • More than 16 digits, or any other character, returns Enter up to 16 hexadecimal digits or a binary number prefixed with 0b.

How the decimal result is printed

The output is the shortest decimal string that converts back to the same double, which is how JavaScript prints numbers. That is why 3FB999999999999A shows 0.1 and not the full 55-digit expansion of the stored value.

Large and small magnitudes switch to exponent notation, such as 1e+21 or 1e-7. Integers above 2^53 are spaced more than 1 apart, so 4340000000000001 prints 9007199254740994. A NaN prints as NaN whatever its sign or payload bits are.

Frequently asked questions

How do I convert hex to double in Python?

Use struct.unpack('>d', bytes.fromhex('C02A800000000000'))[0], which returns -13.25. The '>' selects big-endian order, the same order this tool expects. Switch to a little-endian format only when the bytes come from an x86 or Arm memory dump.

Why is my result a number like 3.88885e-318?

The input had fewer than 16 digits. The tool right-aligns short patterns and fills the top with zeros, which zeroes the exponent field and yields a subnormal. Append the missing trailing zeros so the sign and exponent digits come first.

What does 8000000000000000 decode to?

Negative zero, printed as -0. Only the sign bit is set. It compares equal to 0 in arithmetic, but it is a distinct bit pattern and can appear after operations such as multiplying 0 by a negative number.

Can I see the sign, exponent and fraction separately?

Not on this page, which prints only the decoded number. The IEEE 754 Float64 Converter takes the same hex input and lists the sign bit, the 11 exponent bits, the 52 fraction bits and the value class.

Are different NaN patterns distinguished?

No. 7FF8000000000000, FFF8000000000000 and 7FF0000000000001 all print NaN. The sign bit and payload are discarded when the browser turns the bits into a number, so use a bit-level view when the payload matters.

Related tools