Skip to content
ZeroServer.tools

IEEE 754 Converter

Convert decimal numbers to IEEE 754 floating point binary representation. View sign, exponent, and mantissa bits.

Precision

Breakdown

Actual value:3.140000104904175Hex:
0x4048F5C3
Exponent (8-bit):128 (bias 127) → 2^1

Binary Representation

Sign bit (positive)

0

Exponent (8 bits)

10000000

Mantissa / Significand (23 bits)

10010001111010111000011

Full binary:

01000000010010001111010111000011

How IEEE 754 floating point works

IEEE 754 is the standard for floating-point arithmetic. A 32-bit float has 1 sign bit, 8 exponent bits (biased by 127), and 23 mantissa bits. A 64-bit double has 1 sign bit, 11 exponent bits (biased by 1023), and 52 mantissa bits. The value is calculated as:(-1)^sign × 2^(exponent-bias) × 1.mantissa.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Seeing exactly which bits represent a float that is not behaving as expected.
  • Explaining why 0.1 plus 0.2 does not equal 0.3 by showing the stored values.
  • Checking the precision available at a given magnitude before choosing single or double.
  • Reading a float out of a binary protocol field or a hex dump.
  • Confirming a special value — an infinity or a NaN — from its bit pattern.

Frequently Asked Questions

What are the three parts of a float?
Sign, exponent and mantissa. A 32-bit single is 1 + 8 + 23 bits; a 64-bit double is 1 + 11 + 52. The mantissa carries an implied leading 1 that is never stored, which is where a double's famous "53 bits of precision" comes from — 52 stored plus the free one.
Why is 0.1 not exactly 0.1?
Because a binary fraction can only represent sums of powers of two, and 0.1 is a repeating fraction in binary just as a third is in decimal. The stored double is 0.1000000000000000055511151231257827…, which is why 0.1 + 0.2 famously misses 0.3.
What is the exponent bias?
127 for single, 1023 for double. The stored exponent is the real one plus the bias, so the field is always unsigned — which lets two floats be compared as integers, a trick used in sorting and in hardware.
How are infinity and NaN encoded?
With an all-ones exponent. A zero mantissa alongside it means infinity; any non-zero mantissa is NaN — so there are millions of distinct NaN bit patterns. That is also why NaN ≠ NaN: the comparison is defined on the value, not the bits.
What is a subnormal number?
A value with an all-zero exponent, where the implied leading 1 becomes a leading 0 instead. That fills the gap between zero and the smallest normal float, at the cost of precision — and on some hardware it is dramatically slower to compute with.

Common errors and gotchas

  • Expecting an exact representation for a decimal fraction, which most cannot have in binary.
  • Confusing 32-bit and 64-bit layouts, which have different exponent and mantissa widths.
  • Overlooking byte order, so a hex pattern read from memory appears reversed.
  • Treating NaN as comparable. It is not equal to anything, including itself.
  • Assuming precision is uniform. The gap between representable values grows with magnitude.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate