All tools · Developer

IEEE 754 floating-point converter

See for yourself why 0.1 is not quite 0.1 inside a computer.

Bits

■ sign · ■ exponent · ■ mantissa

How to use

  1. Enter a number (0.1, -1e-7, Infinity) or hex bits, and choose the input and size.
  2. Sign, exponent and mantissa bits are shown in color.
  3. "Exact stored value" shows every digit the computer really holds.

Questions

Why is 0.1 + 0.2 = 0.30000000000000004?

Neither 0.1 nor 0.2 has an exact binary form, so each is stored as the nearest double; the tiny errors add up and show in the result.

32-bit vs 64-bit?

Single precision keeps about 7 significant digits, double about 15–17. JavaScript numbers are doubles.

Is there only one NaN?

No, many bit patterns are NaN; this shows the one your browser produces.

Is my input saved or sent?

No. It is processed in your browser only.

Related tools

All tools