IEEE-754 Converter (floating point)
Enter a number or a hex pattern to see the floating-point bits and the exact value.
Common values:
Bits
🔒 Your input is never sent to a server.
How to use
- Type a number in Decimal and the bits and hex appear at once. Exponent notation (1e-5), NaN and Infinity work too.
- You can also enter hexadecimal (e.g. 3F800000) to get the decimal value. Bits are shown split into sign, exponent and mantissa.
- The table shows the sign, exponent, mantissa and the exact value represented by the bit pattern.
What is floating point?
- Value = (−1)sign × 1.mantissa × 2(exponent − bias). Subnormal numbers use 0.mantissa instead of 1.mantissa.
- half has 5 exponent bits (bias 15) and 10 mantissa bits, float 8 (bias 127) and 23, double 11 (bias 1023) and 52.
- An all-ones exponent means infinity (mantissa 0) or NaN (mantissa ≠ 0); an all-zeros exponent means zero or a subnormal number.
- Rounding uses "nearest, ties to even", the IEEE-754 default.
FAQ
Why can't 0.1 be stored exactly?
In binary 0.1 is a never-ending repeating fraction (0.000110011…), so it is rounded to the nearest value that fits. That is why 0.1 + 0.2 can give 0.30000000000000004.
What is the difference between "Exact value" and "Decimal"?
The exact value is the full decimal expansion of what the bits really represent; "Decimal" in the table is the shortest decimal that converts back to the same bits.
Is there only one NaN?
No. Every pattern with a non-zero mantissa and an all-ones exponent is a NaN. This tool makes a quiet NaN (top mantissa bit set) from typed input.
Results are for reference only and accuracy is not guaranteed. Terms & disclaimer