See what a floating-point number really holds

Why is 0.1 + 0.2 not 0.3? Inspect the sign, exponent, and mantissa bits any number actually stores.

Tools used in this guide

The job

Floating point surprises — 0.1 + 0.2 ≠ 0.3, or a JSON number printing with 17 digits — make sense once you see the binary: doubles store an approximation, not the decimal you typed.

Inspect a value

Enter a decimal or a 64-bit hex pattern and the tool breaks it into sign bit, biased exponent, and mantissa, plus the exact stored value, the hex words, and the next representable values up and down. The gap between neighbours is the precision at that magnitude.

  • Special cases are flagged: ±0, NaN, Infinity, denormals (numbers too small for a normal exponent).
  • Enter hex like `0x3FF0000000000000` to go the other way — bits to value.

Worked example

Enter 0.1. The stored value prints as 0.1000000000000000055511151231257827 — the closest double to 0.1. Add another 0.1's worth of error and the famous 0.30000000000000004 appears.

Where it stops

IEEE-754 binary64 (the double every JS number is) only — not 32-bit floats, decimal floats, or big numbers. For exact decimal work use cents or a decimal library; this tool explains why, not a workaround.