What is an IEEE 754 float?
IEEE 754 is the standard way computers store decimal numbers such as 0.1 or 3.14. A 64-bit double uses 1 sign bit, 11 exponent bits and 52 mantissa bits. A 32-bit float uses 1, 8 and 23. The value is (-1)^sign × 1.mantissa × 2^(exponent minus bias).
Because the number is stored in binary, many everyday decimals cannot be represented exactly. 0.1 has no finite binary form, so the computer stores the nearest value it can. That is why 0.1 + 0.2 is not exactly 0.3. This tool shows the bits, the hex form and the exact decimal value stored, and can also read hex bits back into a number.
How to use the IEEE 754 Float Converter
- Type a number such as 0.1, or hex bits starting with 0x.
- Choose 32-bit float or 64-bit double.
- Read the sign, exponent and mantissa.
- Compare the stored value with what you typed.