IEEE 754 Double Precision (Float64) Converter – Free

This IEEE 754 double precision converter shows the 64 bits behind a number: one sign bit, 11 exponent bits and 52 fraction bits. It also decodes a hex or binary pattern back to its value, entirely in your browser.

How to use the IEEE 754 Float64 Converter tool

  1. Under Input format, choose Number to encode a decimal value, or Hexadecimal or binary bits to decode a stored pattern.
  2. Type the value in the Number or bit pattern box, for example -13.25 or 0xC02A800000000000.
  3. Select Inspect bits. The Example button fills in -13.25 and runs it for you.
  4. Read the Value, Hex, Bits, Sign, Exponent, Fraction and Class lines in the Result box.
  5. Select Copy to copy the result, or Clear to reset the form.

How IEEE 754 double precision stores a number

IEEE 754 binary64 is the double of C and Java, the float of Python and the Number type of JavaScript. It packs a value into 64 bits. The top bit is the sign, the next 11 bits are the exponent, stored with a bias of 1023, and the last 52 bits are the fraction, the digits after the binary point of the significand.

For a normal value the significand has an implied leading 1, so the number equals (-1)^sign x 1.fraction x 2^(exponent - 1023). Two exponent patterns are reserved. All zeros means zero or a subnormal, where the leading digit is 0 and the power is fixed at 2^-1022. All ones means infinity when the fraction is zero and NaN when it is not. The Class line names the case: normal, subnormal, zero, infinity or NaN.

Worked example: -13.25 as a 64-bit double

In binary, 13.25 is 1101.01, or 1.10101 x 2^3. The sign bit is 1 because the value is negative. The exponent field is 3 + 1023 = 1026, which is 10000000010. The fraction is the digits after the leading 1, 10101, followed by 47 zeros.

Value: -13.25
Hex: 0xC02A800000000000
Bits: 1100000000101010100000000000000000000000000000000000000000000000
Sign: 1
Exponent: 10000000010
Fraction: 1010100000000000000000000000000000000000000000000000
Class: normal

Number and bit pattern formats the tool reads

One caution for bit mode: a pattern that begins with 0b and continues with only the digits 0 and 1 is read as binary. If your hex value starts with the digits 0B, write it with the 0x prefix.

  • Number mode takes decimal notation with an optional sign, such as 42, -0.5 or .5, and scientific notation such as 6.02e23. Anything else gives Enter a number, Infinity or NaN.
  • NaN, inf and Infinity are accepted in any letter case, with an optional sign.
  • Bit mode takes up to 16 hexadecimal digits, with or without a 0x prefix, or up to 64 binary digits after a 0b prefix.
  • Spaces inside a bit pattern are ignored, so 4009 21FB 5444 2D18 works. It decodes to 3.141592653589793.
  • A pattern shorter than 64 bits is padded with zeros on the left, so 1 means 0x0000000000000001, the smallest subnormal.

Why the stored value differs from what you typed

Most decimal fractions have no exact double. The tool rounds your input to the nearest representable value, and the Value line prints the shortest decimal that identifies that double.

The 53-bit significand also limits integers. Every whole number up to 2^53 is exact, but 9007199254740993 comes back as 9007199254740992. Inputs beyond the range of the format do not fail: 1e400 becomes Infinity and 1e-400 becomes 0.

Frequently asked questions

What is 0.1 in IEEE 754 double precision?

The nearest double to 0.1 is 0x3FB999999999999A. Its exponent field 01111111011 is 1019, meaning 2^-4, and the fraction repeats 1001 before ending in 1010, rounded up in the last bit. The stored value is slightly above one tenth.

How do I convert a 64-bit hex value to a double?

Set Input format to Hexadecimal or binary bits, paste the 16 hex digits and select Inspect bits. For example, 401A000000000000 decodes to 6.5. Enter the digits most significant first: reverse the byte order of a little-endian memory dump before pasting.

Why does NaN always encode as 0x7FF8000000000000?

In Number mode every spelling of NaN, signed or not, maps to that single quiet NaN pattern. To inspect another encoding, enter it in bit mode, for example 7FF4000000000000. Any pattern with an all-ones exponent and a nonzero fraction is classed as NaN.

Can the converter show negative zero and subnormal numbers?

Yes. Entering -0 gives 0x8000000000000000 with class zero, and 5e-324 gives 0x0000000000000001 with class subnormal. Subnormals fill the gap between zero and the smallest normal double, 2.2250738585072014e-308.

Related tools