What is the IEEE 754 Floating Point Converter?
This tool decodes a 32-bit hexadecimal value into the real number it represents under the IEEE 754 single-precision standard — the format used by the float type in C, Java, and most modern hardware. Enter eight hex digits and the calculator splits them into the three fields that make up a float: 1 sign bit, 8 exponent bits, and 23 mantissa (fraction) bits, then reassembles them into a decimal value.
How to use it
Type the 32-bit value as hexadecimal (for example 40490FDB). The "0x" prefix is optional and any non-hex characters are ignored. Values shorter than 8 digits are zero-padded on the left. The result shows the decimal value plus the decoded sign, stored exponent, unbiased exponent, and mantissa so you can verify the bit layout yourself.
The formula explained
For normal numbers the value is $$\text{Value} = (-1)^{s} \times \left(1 + \frac{m}{2^{23}}\right) \times 2^{(e - 127)}$$ The 127 is the exponent bias for single precision. The "1 +" reflects the implicit leading bit that normalized binary numbers always have. When the stored exponent e is 0, the number is subnormal: the implicit leading 1 disappears and the exponent is pinned at -126. When e is 255 the value is infinity (mantissa 0) or NaN.
Worked example
Take 40490FDB. In binary the sign is 0 (positive), the exponent field is 10000000 = 128, so the unbiased exponent is \(128 - 127 = 1\). The mantissa bits equal 4788187, giving a fraction of \(4788187/8388608 \approx 0.5707964\). The value is $$(1 + 0.5707964) \times 2^{1} \approx 3.14159274$$ — the closest single-precision approximation of π.
Special and Common IEEE 754 Single-Precision Values
These are the IEEE 754 binary32 (single-precision) patterns you will meet most often. The 32 bits split into 1 sign bit, 8 exponent bits (bias 127) and 23 fraction bits. The sign, exponent and mantissa columns show the decoded fields.
| Hex | Sign | Exponent (biased) | Mantissa (fraction field) | Meaning |
|---|---|---|---|---|
| 00000000 | 0 | 0 | 0 | +0 |
| 80000000 | 1 | 0 | 0 | -0 (compares equal to +0) |
| 3F800000 | 0 | 127 | 0 | 1.0 |
| BF800000 | 1 | 127 | 0 | -1.0 |
| 40000000 | 0 | 128 | 0 | 2.0 |
| 3F000000 | 0 | 126 | 0 | 0.5 |
| 40490FDB | 0 | 128 | 0x490FDB (4788187) | ≈ 3.14159274 (closest float to π) |
| 7F800000 | 0 | 255 | 0 | +Infinity |
| FF800000 | 1 | 255 | 0 | -Infinity |
| 7FC00000 | 0 | 255 | 0x400000 (top fraction bit set) | Quiet NaN |
| 00000001 | 0 | 0 | 1 | Smallest positive subnormal, 2-149 ≈ 1.4013e-45 |
| 00800000 | 0 | 1 | 0 | Smallest positive normal, 2-126 ≈ 1.1755e-38 |
| 7F7FFFFF | 0 | 254 | 0x7FFFFF (8388607) | Largest finite value ≈ 3.4028235e38 |
Example decode of 40490FDB: the exponent field is 128, so the scale is \(2^{128-127} = 2\). The mantissa gives \(1 + \frac{4788187}{8388608} \approx 1.5707964\). The product is \(1.5707964 \times 2 \approx 3.1415927\).
Floating-Point Terms Glossary
- Sign bit
- Bit 31. 0 means positive and 1 means negative. It applies to zero, infinity and NaN too, so -0 exists.
- Biased exponent
- The raw 8-bit exponent field (bits 30–23), stored as an unsigned number from 0 to 255.
- Unbiased exponent
- The true power of two, equal to the biased exponent minus 127. For normal numbers it ranges from -126 to +127.
- Exponent bias (127)
- A constant subtracted from the stored exponent. It lets the field represent negative powers without a separate sign.
- Mantissa / significand / fraction
- The 23 stored fraction bits (bits 22–0). "Fraction" is the stored field. "Significand" or "mantissa" often means the full value including the implicit leading bit, giving 24 bits of precision.
- Implicit leading bit
- For normal numbers, a leading 1 before the binary point is assumed and not stored. The significand is \(1 + m/2^{23}\).
- Normal numbers
- Exponent field 1–254. They have the implicit leading 1 and full 24-bit precision.
- Subnormal (denormal) numbers
- Exponent field 0 with a nonzero fraction. The leading bit is 0 and the exponent is fixed at -126, so the value is \(m/2^{23} \times 2^{-126}\). They fill the gap near zero with reduced precision.
- Infinity
- Exponent field 255 with a zero fraction. It results from overflow or division of a nonzero number by zero, and it carries a sign.
- NaN (Not a Number)
- Exponent field 255 with a nonzero fraction. A quiet NaN (top fraction bit set, e.g. 7FC00000) propagates through arithmetic silently. A signaling NaN (top fraction bit clear, nonzero fraction, e.g. 7F800001) is intended to raise an invalid-operation exception when used.
- Machine epsilon
- The gap between 1.0 and the next larger float: \(2^{-23} \approx 1.19 \times 10^{-7}\).
- ULP (unit in the last place)
- The spacing between two adjacent floats at a given magnitude. It doubles each time the exponent increases by one, so absolute precision shrinks for larger numbers.
Interpreting the Decoded Result
Exponent field ranges
- 0: the value is zero (fraction 0) or subnormal (fraction nonzero).
- 1–254: a normal number, \((-1)^s \times \left(1 + \frac{m}{2^{23}}\right) \times 2^{e-127}\).
- 255: infinity (fraction 0) or NaN (fraction nonzero).
Precision
With 24 significant bits, a single-precision float holds about 6–9 significant decimal digits. Any decimal with up to 6 digits survives a round trip through float. Up to 9 digits are needed to identify a float uniquely. Beyond that, the trailing digits are not meaningful.
Why the decimal may differ from what you typed
The converter shows the exact value stored in the bits. Most decimal fractions, such as 0.1, have no finite binary expansion, so they are rounded to the nearest float. Typing 0.1 gives 0x3DCCCCCD. Decoding it:
$$e = 123,\quad m = 5033165,\quad \text{Value} = \left(1 + \frac{5033165}{8388608}\right) \times 2^{123-127} \approx 1.6000000238 \times 0.0625 \approx 0.100000001490116$$
The small excess over 0.1 is rounding error, not a bug in the conversion.
Endianness and memory dumps
The hex value entered here is the logical 32-bit word, with the sign bit as the most significant bit. In memory, byte order depends on the platform. A little-endian system (x86, most ARM configurations) stores 3F800000 (1.0) as the bytes 00 00 80 3F. A big-endian system, and most network protocols, store 3F 80 00 00. If a dump gives a surprising result, reverse the byte order before entering it.
FAQ
Why isn't the result exactly the number I expected? Single precision only has about 7 decimal digits of accuracy, so many decimal values round to the nearest representable float.
What about double precision (64-bit)? This tool handles 32-bit single precision. Doubles use 11 exponent bits, a 52-bit mantissa, and a bias of 1023.
What does 7FC00000 give? That is a NaN (exponent all ones, non-zero mantissa), which is not a finite number.