How to use it
- Choose the Format: half, single or double precision.
- Under Enter a, choose Decimal number to convert a number, or Bit pattern (hexadecimal) to read stored bits.
- Type the value in Value. The page updates as you type.
- Read the coloured bits, the Field table and the result table. A rounding error is shown only for a decimal number.
How a number is split into fields
A binary floating-point number has three fields: a sign bit, an exponent field and a fraction field. Single precision uses 1, 8 and 23 bits; double precision uses 1, 11 and 52; half precision uses 1, 5 and 10. For a normal number the value is (−1)^sign × 1.fraction × 2^(exponent field − bias), where the bias is 127 for single precision (IEEE 754 defines the fields in its binary formats).
0.15625 = 1.25 × 2^−3 → sign 0, exponent 127 − 3 = 124 = 01111100, fraction 0100… → 0 01111100 01000000000000000000000 = 3E200000
Rounding to the nearest value
Most decimal numbers cannot be stored exactly in binary. The page rounds the typed number to the nearest value the format can store, with a tie going to the value whose last bit is even. The distance between two neighbouring values is one ulp (unit in the last place), and the rounding error is at most half an ulp. For 0.1 in single precision the stored value is 0.100000001490116119384765625, so the error is +1.49 × 10^-9, which is 0.2 ulp.
Special values
- Zero: an exponent and fraction of zeros. Its sign bit is kept, so −0 and +0 are two different patterns.
- Subnormal numbers: an exponent field of zeros and no hidden bit. They fill the gap between zero and the smallest normal number.
- Infinity: an exponent of all ones and a fraction of zeros. A decimal that rounds beyond the largest finite number becomes Infinity.
- NaN: an exponent of all ones and a fraction that is not zero. The top fraction bit separates a quiet NaN from a signalling one; the rest of the fraction is the payload.
What the page does not cover
- Arithmetic: the page shows how a number is stored, not the result of adding or multiplying two stored numbers.
- Decimal floating-point formats of IEEE 754-2008, which use base 10, and other formats such as bfloat16 or 8-bit floats.
- Two's complement integers: see the two's complement calculator.
Worked example: 0.1 in single precision
Type 0.1 with Format set to single precision. 0.1 is 1.6 × 2^−4, and the significand 1.6 cannot be written with 23 fraction bits. The fraction rounds up, so the stored value is a little larger than 0.1.
| Result | Value |
|---|---|
| Hexadecimal | 3DCCCCCD |
| Exact stored value | 0.100000001490116119384765625 |
| Rounding error (stored minus typed) | +1.490116119384765625e-9 |
| Rounding error in ulps | +0.200 |
Frequently asked questions
Why is 0.1 + 0.2 not exactly 0.3 in a computer?
Neither 0.1 nor 0.2 can be stored exactly in binary, and their sum is rounded again. In double precision 0.1 + 0.2 gives 0.30000000000000004, the value just above the stored 0.3.
What is the difference between the exact stored value and the typed number?
The typed number is the decimal you wrote. The exact stored value is the binary number the format really keeps, written out in full. The rounding error is their difference, so you can see how far the two are apart.
What does ulp mean?
An ulp is the unit in the last place: the gap between a stored value and the next one in the same binade. Rounding to the nearest value is never more than half an ulp away, and the page gives the error both as a number and in ulps.
Why does 1e39 become Infinity in single precision?
The largest single-precision value is about 3.4028235 × 10^38. A number that rounds beyond it has no finite stored value, so the format uses Infinity, and the page marks the result as too large.
Can a NaN keep information?
Yes. The fraction bits of a NaN are not used for its value, so a program can store a payload there. The page shows the fraction of a NaN as its payload and marks whether it is quiet or signalling.
Sources
- IEEE 754 (IEEE Standards Association)
- IEEE 754 (Wikipedia)
- Single-precision floating-point format (Wikipedia)
- Double-precision floating-point format (Wikipedia)
- Half-precision floating-point format (Wikipedia)
Figures and text last checked on Wednesday, November 11, 2026.