This IEEE-754 binary64 converter shows the layout of one 64-bit floating-point value. The direction is either From decimal or From hex bits. The page does not guess. A hex pattern typed while From decimal is selected is an error, and a decimal token typed while From hex bits is selected is an error.
From decimal accepts one JavaScript numeric token: an optional sign, digits, an optional fraction, and an optional exponent. It also accepts the tokens NaN, Infinity, -Infinity, and +Infinity. The token is checked first. Only after that check does the page call Number. Units, commas, and hex digits are rejected in this direction, so 1px, 1,000, and a 0x pattern do not become a number by accident.
From hex bits accepts exactly 16 hexadecimal digits, with an optional 0x or 0X prefix. Those digits are the 64 bits. They are not passed through Number before the fields are read. Upper and lower case are accepted. The hex line is lowercase.
The result rows are the classification, the sign, the 16-digit hex, the bits grouped as 1 + 11 + 52, the biased exponent, the unbiased exponent when that class has one, the trailing significand, and the JavaScript decimal. Classification is one of zero, subnormal, normal, infinite, or NaN. A normal number has unbiased exponent equal to the biased exponent minus 1023. A subnormal number has biased exponent 0 and unbiased exponent -1022. Zero, infinity, and NaN do not get an unbiased-exponent row. The trailing significand is the stored 52 bits. It does not add the hidden bit of a normal number.
The JavaScript decimal line is Number.prototype.toString of the binary64 value. It is not labeled exact, and the page does not print a full decimal expansion of the rational. A value such as 0.1 is a normal number whose shortest JavaScript spelling is 0.1, which is not the exact fraction stored in the bits. Positive zero and negative zero differ in the sign bit. The sign row says 0 (positive) or 1 (negative zero). Their toString text can both be 0, which is why the sign row is the place that distinguishes them.
A NaN payload is the trailing significand taken from the bits. If you enter 16 hex digits whose exponent field is all ones and whose trailing field is not zero, the classification is NaN and the trailing significand shows that payload. The page also says that JavaScript number arithmetic does not promise to keep a NaN payload, and that this page does not claim signaling-NaN behavior. Copy writes the hex bit pattern and the classification, not the whole table.
Invalid input clears the table. The previous bits do not stay on screen. Nothing is sent off the page and nothing is stored.
From decimal, 1 produces classification normal, sign 0 (positive), hex 3ff0000000000000, biased exponent 1023, unbiased exponent 0, and trailing significand all zeros. The JavaScript decimal is 1. The value 1.5 produces hex 3ff8000000000000. The value 2 has unbiased exponent 1. The value 0.1 stays a normal number and its JavaScript decimal line reads 0.1.
From decimal, 0 produces hex 0000000000000000 and sign 0 (positive). -0 produces hex 8000000000000000 and sign 1 (negative zero). Both classifications are zero. Infinity produces hex 7ff0000000000000 and classification infinite. -Infinity sets the sign bit. From hex bits, 7ff0000000000001 is a NaN whose trailing significand is 1. The JavaScript decimal line is NaN, and the note about payloads is shown. From hex bits, 0000000000000001 is subnormal, with biased exponent 0 and unbiased exponent -1022. Eight hex digits, fifteen hex digits, and seventeen hex digits are rejected. 1px, a comma, and a 0x pattern in From decimal are rejected.
The conversion stays in the browser. A result describes the bits of the value you typed. It does not change how another language rounds, and it does not claim that every arithmetic operation will preserve a NaN payload.
Binary64 only. From decimal accepts one JavaScript numeric token, or NaN, Infinity, -Infinity, or +Infinity, and then uses Number. Hex digits in that direction are rejected. From hex bits reads exactly 16 hex digits, with an optional 0x, as the 64 bits and does not pass them through Number first. The JavaScript decimal line is Number.prototype.toString. It is not the exact rational. 0 and -0 differ in the sign bit. A NaN payload is taken from the bits. JavaScript number arithmetic does not promise to keep a NaN payload, and this page does not claim signaling-NaN behavior. There is no binary32 mode. Nothing is sent or stored.
No. That line is Number.prototype.toString. It is labeled JavaScript decimal. It is not a full exact expansion of the binary64 rational.
Their JavaScript decimal text can both print as 0. The sign row separates them. Positive zero has sign bit 0. Negative zero has sign bit 1 and is labeled negative zero.
The hex bits you entered are shown as entered, including a nonzero trailing significand. JavaScript number arithmetic does not promise to keep a NaN payload, and this page does not claim signaling-NaN behavior.
No. Eight hex digits are rejected. Binary32 is a different format, and this page has no binary32 mode.