IEEE 754 Floating Point Converter

Visualize how floating point numbers are stored in IEEE 754 format.

Special Values

Infinity0x7F800000
-Infinity0xFF800000
NaN0x7FC00000
00x00000000

Code Examples

// Get IEEE 754 bits of a float
function floatToBits(f) {
  const buffer = new ArrayBuffer(4);
  new Float32Array(buffer)[0] = f;
  return new Uint32Array(buffer)[0];
}

floatToBits(1.0).toString(2).padStart(32, '0');
// "00111111100000000000000000000000"

Frequently Asked Questions

Why does 0.1 + 0.2 !== 0.3?

0.1 and 0.2 cannot be exactly represented in binary floating point (like 1/3 in decimal). The small representation errors accumulate, giving 0.30000000000000004.

What are the special IEEE 754 values?

Infinity (exponent all 1s, mantissa 0), -Infinity, NaN (exponent all 1s, mantissa non-zero), denormalized numbers (exponent all 0s for very small values).

Related Tools