Dev · Converter

IEEE 754 float converter: decimal to binary and hex.

Enter a decimal such as 0.1, or a hex or bit pattern, and see the float32 or float64 sign, exponent and fraction bits, the bias, whether it is normal, subnormal, zero, infinity or NaN, and the exact decimal value actually stored. Everything runs in your browser; nothing is sent.

float32: 1 + 8 + 23 bits, bias 127 float64: 1 + 11 + 52 bits, bias 1023

Advertisement

Inputs

A decimal (0.1, -1.5e-3), nan, inf, -inf, 0x hex (8 or 16 digits) or 0b bits (32 or 64).

Result

Enter a value and press Convert.

Advertisement

How an IEEE 754 float is laid out

A binary float is a sign bit, a biased exponent field and a fraction (mantissa) field. float32 uses 1, 8 and 23 bits with bias 127; float64 uses 1, 11 and 52 bits with bias 1023 (IEEE 754-2019). For a normal number the value is (−1)sign × 1.fraction × 2(exponent field − bias). The leading 1 is implied and not stored.

Subnormals, zero, infinity and NaN

An exponent field of all zeros means subnormal (or zero when the fraction is also zero): there is no implied leading 1 and the exponent is fixed at 1 − bias, which lets values shrink gradually towards zero. An exponent field of all ones means infinity when the fraction is zero, otherwise NaN. Under IEEE 754-2019 the top fraction bit distinguishes a quiet NaN (1) from a signaling NaN (0). Zero has a sign, so −0 and +0 are different bit patterns. Worked example from Wikipedia: 0.15625 in float32 is 0x3E200000, with exponent field 124 (124 − 127 = −3).

Why 0.1 + 0.2 is not 0.3

0.1 has no finite binary expansion, so a float64 stores the nearest representable value instead. JavaScript’s Number is float64, and this page reads the bits with DataView and expands them exactly with BigInt. Computed live in your browser:

The sum of the two stored values lands on a different neighbouring float than the one 0.3 rounds to, so the comparison is false. Related: to see signed integers as bit patterns, use the binary converter.

What this does and doesn’t

This shows the bits your browser’s float32/float64 rounding produces (round to nearest, ties to even) and the exact value they represent. It does not cover decimal or half/quad formats. NaN payloads and sign are shown from the bits you give; a NaN typed as text is the browser’s canonical quiet NaN.

Worked examples

Computed by running this page’s converter code on 2026-10-26. Bits are shown as sign, exponent, fraction.

IEEE 754 float examples
InputFormatHexBitsStored value
0.15625float323E2000000 01111100 01000000000000000000000exactly 0.15625 (exponent 124 − 127 = -3)
0.1float323DCCCCCD0 01111011 100110011001100110011010.100000001490116119384765625
0.1float643FB999999999999A0 01111111011 10011001100110011001100110011001100110011001100110100.1000000000000000055511151231257827021181583404541015625

Sources and as-of date

As of 2026-10-26. The field layout and biases are the standard binary32 and binary64 ones; JavaScript Numbers are binary64, and the page reads the bits with a DataView.

Advertisement

Frequently asked questions

Why can’t 0.1 be stored exactly in a float?

0.1 has no finite binary expansion, so the format keeps the nearest value it can. In float32 that is 0.100000001490116119384765625; in float64 it is 0.1000000000000000055511151231257827021181583404541015625.

What is the exponent bias?

The stored exponent is the true exponent plus a bias: 127 for float32 and 1023 for float64. For 0.15625 the stored field is 124, so the true exponent is 124 − 127 = -3.

How many significant digits does each format hold?

float32 has a 24-bit significand (23 stored bits plus the implied leading 1), about 7 decimal digits. float64 has 53 bits, about 15 to 17 decimal digits.

What bit pattern is NaN?

An exponent field of all ones with a non-zero fraction. With a zero fraction the same exponent means infinity.