Floating Point Visualizer

See how computers store decimal numbers in binary across different precision standards.

How to read this?

Floating point numbers are stored like scientific notation in binary: (-1)S × 1.M × 2(E - Bias)

  • Red (Sign): 0 is positive, 1 is negative.
  • Green (Exponent): Determines how large or small the number is (the power of 2).
  • Blue (Mantissa): The fractional part. More bits = more precision digits.

Notice how BFloat16 has the same sized green bar (Exponent) as Float32, whereas Float16 has a much smaller green bar but a slightly larger blue bar (Mantissa) than BFloat16.

How is the value calculated?

The IEEE 754 Conversion Formula

Value = (-1)S × 1.M × 2(E - Bias)

Sign Bit (S)

This single bit acts as a switch for positivity. 0 → (+), 1 → (-).

Exponent (E)

Determines the magnitude. The stored integer is unsigned, so we subtract a Bias.

Mantissa (M)

The precision bits. For normalized numbers, there is an implicit 1 before the decimal point.

Designed with ❤️