IEEE 754 floating-point converter
Encode a value into half, single or double precision, or decode a bit pattern. Click any bit to flip it and watch the value change.
How it works
Encode a value into IEEE‑754 bits: pick Decimal or Binary as the input format, type a number (scientific notation works: 1.5e-10 or, in binary, 1.101e+4), and choose a width. Auto shows every format that can represent the value; explicit widths show just that one, or suggest the next width up if it doesn’t fit.
Decode a hex bit pattern: switch to the Decode tab, choose a width, and paste the bits (0x40490FDB, spaces and underscores are ok).
Click a bit in any result card to flip it. The formula and decoded value update live. The hex field in each card is editable too, a third way to drive the same view.
Why bias? The exponent is stored biased so the bit pattern can be compared as an unsigned integer for ordering. For an exponent field of k bits, bias = 2k−1 − 1: 15 for half (5 exponent bits), 127 for single (8), 1023 for double (11). Half is 1 sign, 5 exponent and 10 mantissa bits; single is 1, 8 and 23; double is 1, 11 and 52.
Categories: Normal numbers have an implicit leading 1. When the exponent field is all zeros, you get subnormals (implicit leading 0, smallest non-zero magnitudes) or ±0. When the exponent field is all ones, you get ±∞ (mantissa zero) or NaN (mantissa non-zero).
Representations
A floating-point number is sign × significand × 2exponent. IEEE‑754 stores the exponent with a bias and leaves the significand's leading 1 implicit, so almost every bit pattern is a different number. Two non-negative floats also sort in the same order as their bit patterns read as integers.