IEEE 754 Float Inspector
See how a number is stored as a 64-bit double or 32-bit float: sign, exponent and mantissa bits, hex, the exact decimal value stored and the gap to the next value.
Free · No sign-up · Your inputs stay in your browser
Input
Inspect IEEE 754 floating-point numbers
Output
Stored as 0.10000000000000000555111512312578270211...
| Sign | positive |
|---|---|
| Exponent | -4 |
| Mantissa bits | 52 |
| Hex | 0x3fb999999999999a |
| Exact stored value | 0.1000000000000000055511151231257827021181583404541015625 |
| Shortest round-trip | 0.1 |
| Gap to next value (ULP) | 1.388e-17 |
Most decimal fractions have no exact binary form, so 0.1 is stored as the nearest double, which is slightly more than 0.1; adding two such errors gives 0.30000000000000004. The exact decimal value of the stored bits is shown in full. Doubles hold every integer up to 2^53 exactly and nothing beyond; money belongs in integers of cents or a DECIMAL column, never in a float.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Why 0.1 + 0.2 is not 0.3
0.1 has no finite binary representation, so the stored double is the nearest one, which is slightly more than 0.1, and 0.2 is likewise slightly off. Their sum lands on a different double from the one nearest 0.3, printed as 0.30000000000000004. The format is defined by IEEE 754; the classic explanation is Goldberg's What Every Computer Scientist Should Know About Floating-Point Arithmetic.
Practical consequences
Never compare floats for exact equality; compare with a tolerance. Doubles hold every integer up to 2^53 exactly and no further, which is why large ids must travel as strings in JSON. Money belongs in integer cents or a decimal type.