Skip to content
MoneyDeck

IEEE 754 Float Converter

See the exact sign, exponent and mantissa bits of any float or double

Updated · Free, no signup

Hexadecimal

0x3DCCCCCD

Binary (sign | exponent | mantissa)

0 01111011 10011001100110011001101

Stored value (shortest round-trip)

0.1

Exact stored value

0.100000001490116119384765625

Rounding error (stored − typed)

+1.490116e-9

Classification

Normal

Sign bit

0

Biased exponent

123

Actual exponent (power of 2)

-4

Mantissa (fraction) bits

10011001100110011001101
  • Value = (−1)^0 × 1.10011001100110011001101₂ × 2^-4.
  • 0.1 cannot be represented exactly in binary; the nearest 32-bit value differs by +1.490116e-9.

About the IEEE 754 Float Converter

This IEEE 754 converter shows exactly how a number is stored as a single-precision (32-bit float) or double-precision (64-bit double) floating-point value. Type a decimal such as 0.1 to see its hexadecimal and binary encoding split into sign, exponent and mantissa fields, or paste a hex or binary pattern from a memory dump to decode it back into a number.

It is built for programmers chasing floating-point surprises (why 0.1 + 0.2 ≠ 0.3), students learning computer arithmetic, and embedded developers decoding sensor data or network packets. Besides the bit fields, the tool prints the exact decimal value that is actually stored — every binary fraction has a finite decimal expansion — and the rounding error between that and what you typed.

Conversion uses round-to-nearest-even, the IEEE 754 default, via the browser's native float handling. Special values are supported: type inf, -inf or nan, and subnormal numbers near zero are labelled as such.

How to use the ieee 754 float converter

  1. 1Choose whether you are entering a decimal number or a hex/binary bit pattern.
  2. 2Type the value — for example 0.1, -118.625 or 0x40490FDB.
  3. 3Pick 32-bit single precision or 64-bit double precision.
  4. 4Read the hex and the sign | exponent | mantissa binary split.
  5. 5Check the exact stored value and rounding error to see how much precision was lost.

Formula and method

value = (−1)^s × 1.f × 2^(e − bias) (normal) · value = (−1)^s × 0.f × 2^(1 − bias) (subnormal)

An IEEE 754 binary float has three fields. Single precision uses 1 sign bit, 8 exponent bits and 23 fraction (mantissa) bits with a bias of 127; double precision uses 1, 11 and 52 bits with a bias of 1023. For normal numbers the stored exponent e is offset by the bias and an implicit leading 1 is placed before the fraction bits, giving 24 or 53 bits of precision.

An exponent field of all zeros means zero or a subnormal number (no implicit 1, exponent fixed at 1 − bias); all ones means infinity (fraction 0) or NaN. A decimal you type is rounded to the nearest representable value, ties to even. Because the stored value is m × 2^k, it always has a finite decimal expansion, which the tool prints exactly using big-integer arithmetic along with the difference from your input.

s
Sign bit (0 = positive, 1 = negative)
e
Stored (biased) exponent field
bias
127 for 32-bit, 1023 for 64-bit
f
Fraction (mantissa) bits after the binary point

Worked examples

0.1 as a 32-bit float

0.1 = 1.6 × 2⁻⁴, so the biased exponent is −4 + 127 = 123 (01111011). The fraction 0.6 is the repeating binary 1001 1001…, rounded up in the last bit, which makes the stored value 0.100000001490116… — about 1.49 × 10⁻⁹ too large.

0.1 as a 64-bit double

In double precision the exponent field is −4 + 1023 = 1019 and the 52-bit fraction is 999…9A in hex. The stored value is still not exactly 0.1, but the error shrinks to about 5.55 × 10⁻¹⁸ — the reason 0.1 + 0.2 prints as 0.30000000000000004.

−118.625 is exactly representable

118.625 = 1110110.101₂ = 1.110110101₂ × 2⁶. The sign bit is 1, the biased exponent is 6 + 127 = 133, and because the fraction ends after 9 bits there is no rounding error.

Decode the hex pattern 0x40490FDB

0x40490FDB is the float32 closest to π. Its exponent field is 128 (2¹) and the stored value is 3.14159274101…, which prints as 3.1415927 — the shortest decimal that rounds back to the same float.

Frequently asked questions

Why can’t 0.1 be represented exactly in floating point?+

0.1 is 1/10, and 10 has a factor of 5, so in binary it becomes the endless repeating fraction 0.000110011001100… Any finite number of bits must round it, leaving a tiny error (about 1.5 × 10⁻⁹ in float32 and 5.6 × 10⁻¹⁸ in float64).

What is the difference between single and double precision?+

Single precision (float) uses 32 bits: 8 exponent bits and 23 fraction bits, about 7 significant decimal digits. Double precision uses 64 bits: 11 exponent and 52 fraction bits, about 15–17 significant digits and a far larger range (up to about 1.8 × 10³⁰⁸).

What is the exponent bias in IEEE 754?+

The stored exponent is the real exponent plus a bias so it can be stored as an unsigned number: 127 for 32-bit floats and 1023 for 64-bit doubles. A stored value of 130 in a float therefore means 2³.

What are subnormal (denormal) numbers?+

When the exponent field is all zeros and the fraction is non-zero, the number is subnormal: there is no implicit leading 1, which allows gradual underflow toward zero. The smallest positive float32 subnormal is about 1.4 × 10⁻⁴⁵.

How are infinity and NaN encoded?+

Both use an exponent field of all ones. A fraction of zero means infinity (sign bit chooses + or −), and any non-zero fraction means NaN. For float32, +∞ is 0x7F800000 and the usual quiet NaN is 0x7FC00000.

Related tools