IEEE 754 Floating-Point Converter
Convert decimals to IEEE 754 half, single and double precision and back: hex and binary bits, exponent, mantissa, exact stored value and rounding error.
| Format | Hex | Stored value (shortest) | Rounding error |
|---|---|---|---|
| binary16 | 0x2E66 | 0.1 | -2.441e-5 |
| binary32 (selected) | 0x3DCCCCCD | 0.1 | 1.490e-9 |
| binary64 | 0x3FB999999999999A | 0.1 | 5.551e-18 |
| Format | Sign | Exponent bits | Mantissa bits | Bias | Largest finite | Smallest normal | Smallest subnormal |
|---|---|---|---|---|---|---|---|
| binary16 (half) | 1 | 5 | 10 | 15 | 65504 | 6.10352e-5 | 5.96046e-8 |
| binary32 (single) | 1 | 8 | 23 | 127 | 3.40282e+38 | 1.17549e-38 | 1.40130e-45 |
| binary64 (double) | 1 | 11 | 52 | 1023 | 1.79769e+308 | 2.22507e-308 | 4.94066e-324 |
Computers store most non-integer numbers in IEEE 754 binary floating point, which cannot represent 0.1 or 1/3 exactly. This converter shows the exact bits a number becomes in half (16-bit), single (32-bit float) and double (64-bit double) precision, splits them into sign, exponent and mantissa, and prints the exact decimal value that is really stored together with the rounding error. It also decodes a hex or binary bit pattern back into a number, including zeros, subnormals, infinities and NaN.
How to use this tool
- Type a number — a decimal such as 0.1, a fraction such as 1/3, a C hex float, inf or nan — or paste a bit pattern.
- Choose whether the value is a number or hex/binary bits.
- Pick half, single or double precision.
- Read the hex and binary encoding, the field breakdown, the exact stored value and the error; the table compares all three formats.
Formula
value = (−1)^sign × 1.mantissa₂ × 2^(exponent − bias) · subnormal: (−1)^sign × 0.mantissa₂ × 2^(1 − bias)
Bias = 15 (half), 127 (single), 1023 (double). An exponent field of all zeros means zero or a subnormal; all ones means infinity (mantissa 0) or NaN. Conversion uses exact integer arithmetic and rounds to nearest, ties to even, so the result matches a correctly rounding compiler or parser; the shortest round-trip decimal is the shortest number that converts back to the same bits.
Example
0.1 in single precision becomes 0x3DCCCCCD = 0 01111011 10011001100110011001101: sign 0, exponent 123 − 127 = −4, significand 1.60000002384185791015625. The stored value is exactly 0.100000001490116119384765625, so the rounding error is +0.000000001490116119384765625. In double precision 0.1 becomes 0x3FB999999999999A, about 0.1000000000000000055511.
Frequently asked questions
Why is 0.1 + 0.2 not 0.3?
None of the three numbers is exactly representable in binary. Each is rounded to the nearest double, and the rounding errors do not cancel, so the sum is 0.30000000000000004 rather than the double nearest to 0.3.
What is a subnormal number?
A value smaller than the smallest normal number. The exponent field is zero and there is no hidden leading 1, which lets values fade gradually towards zero, at the cost of precision.
Why does 65520 become infinity in half precision?
The largest half-precision value is 65504. 65520 lies exactly halfway between 65504 and the next step, 65536, which is beyond the format, and round-to-nearest-even sends it to infinity.
What is the difference between a quiet and a signaling NaN?
Both are "not a number". The top mantissa bit is 1 for a quiet NaN, which passes silently through arithmetic; a signaling NaN has it 0 and is meant to raise an exception when used.
Sources
Last updated:
Page address with these inputs: https://kakao.mobile/tools/ieee-754-converter/
Cite or embed this tool
kakaoCalc. (2026, November 8). IEEE 754 Floating-Point Converter. https://kakao.mobile/tools/ieee-754-converter/
“IEEE 754 Floating-Point Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/ieee-754-converter/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms