AZ Tools

IEEE 754 Float Converter (32 & 64-bit)

Convert

Floating-point numbers are stored as a sign bit, a biased exponent, and a fraction (mantissa), and the gap between what you type and what's actually stored is the source of countless rounding bugs. This converter shows the exact IEEE 754 representation of any decimal number in both float32 (single, 1+8+23 bits, bias 127) and float64 (double, 1+11+52 bits, bias 1023): the colour-coded bit string, the hex word, the unbiased exponent and significand, the value category (normal, subnormal, zero, infinity, NaN), and the value actually stored after rounding. It also runs in reverse — paste an 8- or 16-digit hex word and get the decoded number plus its full breakdown. Handy for debugging serialization, shader and embedded code, GPU buffers, and 'why isn't 0.1 + 0.2 == 0.3' questions. Special inputs Infinity, -Infinity, and NaN are accepted. Everything runs locally; nothing is uploaded.

float32 (single)normal
00111101110011001100110011001101
0x3dcccccd
Sign
0 (+)
Exponent
123 (2^-4)
Significand
1.10011001100110011001101
Stored
0.10000000149011612

Rounded — float32 cannot store this value exactly.

float64 (double)normal
0011111110111001100110011001100110011001100110011001100110011010
0x3fb999999999999a
Sign
0 (+)
Exponent
1019 (2^-4)
Significand
1.1001100110011001100110011001100110011001100110011010
Stored
0.1
sign exponent fraction

float32 = 1 sign + 8 exponent + 23 fraction bits; float64 = 1 + 11 + 52. Exponent bias is 127 / 1023.

How to use

  1. Keep 'Decimal → bits' and type a number (e.g. 0.1, -3.14, 1e10, Infinity, NaN) to see both float32 and float64.
  2. Read the sign / exponent / mantissa split, the hex word, and the stored value; a note flags when float32 had to round.
  3. Switch to 'Bits → decimal', pick the precision, and paste a hex word to decode it back to a number.

Frequently asked questions

Why does the stored value differ from what I typed?
Most decimal fractions can't be represented exactly in binary floating point. The tool shows the nearest representable value — e.g. 0.1 in float32 is actually 0.100000001490116119384765625. A rounding note appears whenever the stored float32 value differs from your input; float64 stores the same value JavaScript already uses.
What do the coloured bits mean?
Red is the sign bit (0 positive, 1 negative), blue is the exponent (biased: subtract 127 for float32 or 1023 for float64 to get the power of two), and green is the fraction/mantissa. For normal numbers the significand is 1.fraction; for subnormals it's 0.fraction with the minimum exponent.
How are infinity, NaN, and zero shown?
An all-ones exponent with a zero fraction is ±infinity; an all-ones exponent with a non-zero fraction is NaN; an all-zero exponent and fraction is ±zero (note the distinct sign bit of -0); and an all-zero exponent with a non-zero fraction is a subnormal number. The category is labelled on each card.
What hex format does decoding expect?
The big-endian hex of the raw bits: 8 hex digits for float32 (e.g. 3f800000 = 1.0) and 16 for float64 (e.g. 3ff0000000000000 = 1.0). A leading 0x and spaces are ignored, and shorter input is zero-padded on the left.

Related tools