The IEEE-754 double-precision format (also called binary64) is how almost every programming language stores double and JavaScript number values. This inspector takes any decimal you enter and reveals the exact 64-bit pattern the processor holds for it, broken into its three fields.
Bit layout
bit 63 bits 62..52 bits 51..0
sign(1) exponent(11) mantissa(52)
- Sign (1 bit) —
0for positive,1for negative. - Biased exponent (11 bits) — true exponent plus a bias of 1023. Stored
value 1024 = actual exponent
+1. - Mantissa / fraction (52 bits) — the significant digits, with an implicit
leading
1.giving an effective 53 bits of precision (~15–16 significant decimal digits).
The reconstructed value: (-1)^sign × 1.mantissa × 2^(exponent − 1023).
Special value encoding
| Pattern | Meaning |
|---|---|
| Exp all-zero, mantissa zero | ±0 |
| Exp all-zero, mantissa non-zero | Subnormal (denormal) |
| Exp all-one, mantissa zero | ±Infinity |
| Exp all-one, mantissa non-zero | NaN (quiet or signaling) |
Worked examples — notable bit patterns
1.0: sign 0, stored exponent 1023 (= 1023 + 0, true exp = 0), mantissa
all zeros. Hex: 3FF0 0000 0000 0000.
-1.0: same as 1.0 but sign bit flipped. Hex: BFF0 0000 0000 0000.
0.1: there is no exact binary representation. The mantissa is a repeating
bit pattern rounded to 52 bits, giving the stored value
3FB9 999999999A in hex, which decodes to
0.1000000000000000055511151231257827021181583404541015625 — the true
stored value of “0.1” in a JavaScript number. This is why 0.1 + 0.2 returns
0.30000000000000004 rather than 0.3.
Maximum finite double: 7FEF FFFF FFFF FFFF, approximately 1.7976931348623157 × 10^308.
Smallest positive normal: 0010 0000 0000 0000, approximately 2.225 × 10^-308.
Why this matters in practice
- Money: never store currency as a float64. Use integer cents or a decimal
library —
$0.10stored as a float accumulates rounding errors across sums. - Equality tests:
a === bcan fail for two values that print identically. Use an epsilon comparison for floats:Math.abs(a - b) < Number.EPSILON. - Integer range: float64 represents integers exactly up to
2^53 = 9,007,199,254,740,992. Above that, consecutive integers share the same representation — useBigIntfor ids or counters exceeding that limit.
Precision and the effective digit count
With 52 stored mantissa bits plus the implicit leading 1, a float64 has an
effective significand of 53 bits. That gives approximately log10(2^53) ≈ 15.95
significant decimal digits. This means:
- Values with up to 15 significant digits round-trip perfectly through decimal and back (for many — but not all — such values).
- Values requiring more than 15–16 significant digits are rounded at the 53rd bit.
- Adjacent representable doubles near the value
xdiffer by roughlyx × 2^-52, called the machine epsilon at x or ulp (unit in the last place).
Understanding ulp size is important for numerical algorithms: two computed values that differ by less than 1 ulp cannot be distinguished in float64 arithmetic, even if mathematically they should be different.
The tool reads bits directly via a browser DataView — nothing is uploaded.