A decimal number to single or double precision bits (sign, biased exponent, mantissa) with the exact stored value and the rounding error, and back.
Procedure
How it works
Floating point numbers store $x = (-1)^s \cdot 1.f \cdot 2^{e}$ in three fields: a sign bit, an exponent with a bias added (127 in single precision, 1023 in double) and the fraction $f$, the bits after the point. The leading 1 is not stored, it is always there (the hidden bit). Single precision has 8 exponent and 23 fraction bits, double precision 11 and 52.
To convert a decimal number, write it in binary (the fractional part by repeated doubling), move the point behind the first 1, and round to the available bits: to nearest, and on an exact tie to the even neighbour. Most decimal fractions never end in binary: 0.1 is $0.000110011001100\ldots_2$, so the stored value is a little off, 0.100000001490116… in single precision. This tool computes the conversion exactly with big integers, so the stored value and the rounding error are shown to the last digit.
Some patterns are special. An exponent field of all zeros means zero or a subnormal number (no hidden 1, for gradual underflow down to $2^{-149}$, about 1.4e-45, in single precision); all ones means infinity (fraction 0) or NaN, not a number. And there are two zeros, +0 and -0.
Everything is calculated in your browser. Nothing you type leaves your device.