IEEE 754 Float

Convert between decimal numbers and IEEE 754 floating-point binary representation. Essential for computer engineering and low-level programming.

Enter any decimal number. Supports positive/negative and fractional values.

Understanding IEEE 754

32-Bit Float Structure

IEEE 754 single precision (32-bit) floating-point numbers consist of three components: sign bit, exponent, and mantissa. This format provides a balance between range and precision.

Bit allocation:
Sign: 1 bit (bit 31)
Exponent: 8 bits (bits 30-23)
Mantissa: 23 bits (bits 22-0)
Total: 32 bits

Special Values

  • Zero: All bits zero (±0.0)
  • Infinity: Exponent all 1s, mantissa all 0s (±∞)
  • NaN: Exponent all 1s, mantissa non-zero
  • Denormals: Exponent zero, small numbers
  • Normals: Exponent between 1 and 254

Key Concepts

  • Bias: Exponent stored as unsigned 8-bit + 127 bias (range -126 to +127)
  • Normalized: Leading 1 implicit in mantissa for normal numbers
  • Precision: ~7 decimal digits, 24 bits of precision
  • Range: ±1.18×10^-38 to ±3.4×10^38
  • Endianness: Can be stored big-endian or little-endian
  • Language support: float in C/C++/Java, Single in .NET