IEEE 754 Floating Point Converter

Convert decimal, hex or binary as a 32-bit float or 64-bit double. Inspect the stored bits and rounding error.

Ready · float32

Exact decimal & rounding
Exact stored value
—
Stored − input
—
Byte order
Big-endian bytes
—
Little-endian bytes
—

Your decimal input is kept as entered. The stored value shows the nearest representable number.

Bit inspector inspired by H. Schmidt’s IEEE-754 Floating Point Converter.

/usage

Decimal to IEEE 754, and IEEE 754 to decimal

  1. Choose 32-bit single precision or 64-bit double precision.
  2. Edit Decimal to encode a number, or paste a complete hex or binary bit pattern to decode it. The other fields update immediately.
  3. Inspect the sign, exponent and fraction bits. Open Exact decimal & rounding to compare the stored value with your input, or Byte order to copy the encoded bytes.

Hexadecimal means the encoded bits: 3F800000 is float32 1. Hex input accepts spaces, underscores and a 0x prefix, with exactly 8 digits for float32 or 16 for float64. Byte order shows both endian layouts; hex input is the complete word in most-significant-byte-first order.

Bookmarks keep the width and compact Values or Bits view, without saving your number. Existing #float and #twos-complement bookmarks remain supported. For signed binary and integer conversions, use the dedicated two’s complement calculator.

/examples

Why 0.1 differs in float32 and float64

The binary expansion of 0.1 repeats, so neither format stores it exactly. Both round to the nearest representable value, with ties going to an even significand.

FormatHex bitsExact stored decimal
Float32 / single3DCCCCCD0.100000001490116119384765625
Float64 / double3FB999999999999A0.1000000000000000055511151231257827021181583404541015625

For float32, sign 0, exponent 01111011 and fraction 10011001100110011001101 encode the result. The exponent field is 123; subtracting the bias 127 gives −4. The stored value exceeds 0.1 by 0.000000001490116119384765625.

/formats

Sign, exponent and mantissa

FormatSignExponent / biasFraction (mantissa)
Float32 / binary321 bit8 bits / 12723 bits
Float64 / binary641 bit11 bits / 102352 bits

A normal value is (−1)^sign × (1 + fraction / 2^fractionBits) × 2^(exponent − bias). The leading 1 is implicit. Subnormal values use a leading 0 and the minimum normal exponent instead.

Decimal input is rounded directly from its digits using integer arithmetic, avoiding an intermediate float64 rounding before float32 conversion. Inspect the complete stored decimal and signed conversion error under Exact decimal & rounding. Reference: Oracle’s IEEE arithmetic guide.

/special-values

Negative zero, NaN and subnormal values

Positive and negative zero have different sign bits. Infinity has an all-ones exponent and a zero fraction; NaN has an all-ones exponent and a nonzero fraction. Raw NaN payload bits are preserved when you enter hex or binary. This tool supports binary32 and binary64.

Float32 valueHex bitsMeaning
1.53FC00000Exactly representable
−080000000Only the sign bit is set
+Infinity7F800000All exponent bits set
Smallest positive subnormal000000012^−149