Binary Number to Floating Point Converter
Convert binary IEEE 754 representations to floating point decimal values. Supports 32-bit single and 64-bit double precision with full bit-field breakdown.
About
IEEE 754 is the universal standard governing floating-point arithmetic in virtually all modern processors. A single misinterpreted bit in the exponent field shifts the decoded value by orders of magnitude. This converter decodes raw binary strings into their decimal floating-point equivalents for both 32-bit single precision (bias 127, 8-bit exponent, 23-bit mantissa) and 64-bit double precision (bias 1023, 11-bit exponent, 52-bit mantissa). It correctly handles all five IEEE 754 classes: normalized numbers, denormalized (subnormal) numbers, positive and negative zero, infinities, and NaN (Not a Number).
The tool assumes the input is a complete IEEE 754 bit pattern. It does not convert arbitrary binary integers or binary fractions into floats. If you supply 32 bits, single precision is assumed. If you supply 64 bits, double precision is assumed. Partial inputs are zero-padded on the right. Approximation error inherent to IEEE 754 representation is not introduced by this tool. The decoded decimal value is the exact value the bit pattern encodes per the standard.
Formulas
The IEEE 754 standard encodes a floating-point number using three fields: a sign bit s, a biased exponent e, and a mantissa (significand) m. The general decoding formula for normalized numbers is:
For denormalized (subnormal) numbers where all exponent bits are zero:
Where s is the sign bit (0 = positive, 1 = negative). e is the unsigned integer value of the exponent field. bias is 127 for 32-bit or 1023 for 64-bit. bi is the i-th bit of the mantissa field. N is the number of mantissa bits (23 for single, 52 for double). The implicit leading 1 (normalized) or 0 (denormalized) is the "hidden bit" convention that grants one extra bit of precision without storage cost.
Reference Data
| Category | Exponent Bits | Mantissa Bits | Condition | Decoded Value |
|---|---|---|---|---|
| Positive Zero | All 0 | All 0 | s = 0 | +0.0 |
| Negative Zero | All 0 | All 0 | s = 1 | โ0.0 |
| Denormalized (Subnormal) | All 0 | โ 0 | Implicit leading 0 | (โ1)s ร 21โbias ร 0.mantissa |
| Normalized | 0 < e < max | Any | Implicit leading 1 | (โ1)s ร 2eโbias ร 1.mantissa |
| Positive Infinity | All 1 | All 0 | s = 0 | +โ |
| Negative Infinity | All 1 | All 0 | s = 1 | โโ |
| Signaling NaN | All 1 | MSB = 0, rest โ 0 | Raises exception | NaN (signaling) |
| Quiet NaN | All 1 | MSB = 1 | Propagates silently | NaN (quiet) |
| Single Precision (float32) | 8 bits [30:23] | 23 bits [22:0] | Bias = 127 | Range: ยฑ3.4028235 ร 1038 |
| Double Precision (float64) | 11 bits [62:52] | 52 bits [51:0] | Bias = 1023 | Range: ยฑ1.7976931 ร 10308 |
| Smallest Positive Normal (f32) | 00000001 | All 0 | e = 1 | 1.17549435 ร 10โ38 |
| Largest Positive Normal (f32) | 11111110 | All 1 | e = 254 | 3.40282347 ร 1038 |
| Smallest Positive Subnormal (f32) | All 0 | 000...001 | Denormalized | 1.40129846 ร 10โ45 |
| Machine Epsilon (f32) | N/A | N/A | 2โ23 | 1.19209290 ร 10โ7 |
| Machine Epsilon (f64) | N/A | N/A | 2โ52 | 2.22044605 ร 10โ16 |
| Smallest Positive Subnormal (f64) | All 0 | 000...001 | Denormalized | 4.94065646 ร 10โ324 |