IEEE 754 Floating Point Calculator
See how a decimal number is stored as a 32 or 64-bit float, and its error.
What the IEEE 754 Floating Point Calculator does
IEEE 754 stores a number as a sign bit, a biased exponent and a mantissa — scientific notation in binary. Because the mantissa has fixed length, most decimal fractions cannot be stored exactly, and the small error that results is the root of nearly every floating-point surprise.
Formula
Value = (−1)^sign × 1.mantissa × 2^(exponent − bias)float32: 1 + 8 + 23 bits, bias 127float64: 1 + 11 + 52 bits, bias 1023Machine epsilon = 2^−mantissa bits
Inputs explained
| Input | Unit | Required | Notes |
|---|---|---|---|
| Decimal value | text | Yes | — |
| Precision | one of 2 options | Yes | — |
How to use it
- Choose Precision.
- Enter Decimal value.
- Select Calculate.
Worked example
Storing 0.1 as a 64-bit double.
- Value
- 0.1
- Precision
- Double (64-bit)
Stored as 0.1000000000000000055511151231257827 — an error of about +5.55 × 10⁻¹⁸. The bit pattern is 0x3FB999999999999A, with the mantissa repeating 1001 forever.
Frequently asked questions
Why does 0.1 + 0.2 not equal 0.3?
Neither 0.1 nor 0.2 is exactly representable in binary. Their stored values sum to something marginally above 0.3, and that sum is a different double from the one nearest 0.3.
When should I use float32 instead of float64?
When memory or bandwidth matters more than precision — graphics, machine learning weights, large sensor arrays. Seven significant digits is often plenty.
What is machine epsilon?
The gap between 1.0 and the next representable value: 2⁻⁵² for doubles, about 2.22 × 10⁻¹⁶. It sets the relative precision floor.