How to use the Floating Point Converter
- 1. Pick a directionDecimal to IEEE 754, or hex/bits back to decimal.
- 2. Enter the valueLike 0.1, -12.75, 6.02e23, or a hex word like 3DCCCCCD.
- 3. Read the bitsColour-coded sign, exponent and fraction, plus the exact value.
How IEEE 754 stores a number
A floating-point number is stored like scientific notation in binary: (−1)^sign × 1.fraction × 2^(exponent − bias).
- Single precision (float, 32 bits): 1 sign bit, 8 exponent bits with bias 127, and 23 fraction bits, giving about 7 significant decimal digits.
- Double precision (double, 64 bits): 1 sign bit, 11 exponent bits with bias 1023, and 52 fraction bits, giving about 15–16 digits.
- Special patterns: an exponent of all 0s means zero or a subnormal number; all 1s means infinity or NaN.
Most decimal fractions can't be written exactly in binary, just as 1/3 can't be written exactly in decimal. The value is rounded to the nearest one the format can hold, and the tool shows that exact stored value in full, worked out with exact integer arithmetic.
Worked example
0.1 as a single-precision float:
- Hex 0x3DCCCCCD.
- Sign 0 (positive); exponent 01111011 = 123, so the real exponent is 123 − 127 = −4; fraction 10011001100110011001101.
- Exact stored value: 0.100000001490116119384765625, a little more than 0.1.
That tiny error is why 0.1 + 0.2 == 0.3 is false in Python, JavaScript, Java and C. It's also why money should be handled as whole paise or with a decimal type, never with floats.
Going the other way, paste 40490FDB to see the single-precision value closest to π (3.1415927410125732421875), or 16 hex digits for a double.
Frequently asked questions
Why does 0.1 + 0.2 give 0.30000000000000004?
Neither 0.1 nor 0.2 is exact in binary, and their rounded sum isn't the double closest to 0.3.
What is a subnormal number?
A tiny value below the normal range, stored with an exponent of all 0s and no hidden leading 1. It trades precision for range near zero.
Is -0 different from 0?
It has a different bit pattern (sign bit 1), but compares equal to 0. Try -0 in the tool to see it.
Is the floating point converter free to use?
Yes, the floating point converter is free and costs nothing. Your first conversion shows a short form for your name and WhatsApp number one time; once that's done, this tool and every other Uncodemy tool open with no form.