IEEE 754 Floating-Point Converter
Convert decimal values to IEEE 754 binary32 (32-bit float) or binary64 (64-bit double), or decode an IEEE 754 bit pattern into a decimal value. Inspect the sign, biased exponent, fraction, complete binary representation, and hexadecimal encoding.
IEEE 754 Calculator
IEEE 754 bit fields
How the value is represented
What Is IEEE 754?
IEEE 754 is a widely used standard for representing and calculating floating-point numbers. Binary32 uses 32 bits, while binary64 uses 64 bits. Each representation contains a sign bit, an exponent field, and a fraction field. NIST's numerical methods reference describes these binary interchange formats.
| Property | Binary32 | Binary64 |
|---|---|---|
| Total bits | 32 | 64 |
| Sign bits | 1 | 1 |
| Exponent bits | 8 | 11 |
| Fraction bits | 23 | 52 |
| Exponent bias | 127 | 1023 |
| Significand precision | 24 binary digits | 53 binary digits |
1. Sign bit
The first bit identifies the sign. A sign bit of 0 means positive or positive zero; a sign bit of 1 means negative or negative zero.
2. Exponent field
For normal finite values, the exponent is stored with a bias. Subtract 127 for binary32 or 1023 for binary64 to obtain the actual exponent. All-zero and all-one exponent fields have special meanings for zero, subnormal numbers, infinity, and NaN.
3. Fraction field
For normal numbers, the fraction field stores the bits after an implicit leading 1 in the significand. Subnormal numbers use an implicit leading 0 instead. The exponent and fraction together determine the represented magnitude.
IEEE 754 conversion formula
Value = (−1)sign × (1 + fraction) × 2stored exponent − bias
For subnormal values, the leading significand bit is 0 and the exponent is fixed at 1 − bias.Why can the converted number differ from the input?
Many decimal fractions cannot be represented exactly with a finite number of binary fraction bits. For example, 0.1 is repeating in binary. The converter shows the value represented by the selected format, which can differ slightly from the original decimal input.
What are infinity, NaN, and subnormal values?
- Infinity: a special representation for positive or negative infinity.
- NaN: “Not a Number,” represented by an all-one exponent and a nonzero fraction.
- Subnormal: a nonzero value with an all-zero exponent field, allowing values closer to zero than the normal range.
- Signed zero: positive and negative zero have different encodings.
Frequently Asked Questions
What is the difference between binary32 and binary64?
Binary32 has 32 total bits, an 8-bit exponent, and a 23-bit fraction. Binary64 has 64 total bits, an 11-bit exponent, and a 52-bit fraction. Binary64 generally provides greater precision and a wider range.
Can I convert IEEE 754 bits back into a decimal number?
Yes. Select “IEEE 754 bits to decimal,” choose the correct format, and enter exactly 32 or 64 binary digits. The tool decodes the sign, exponent, and fraction fields.
Why does 0.1 have a long binary representation?
The decimal fraction 0.1 has no finite binary expansion. The floating-point format stores a nearby representable value, so displaying the full decoded value may reveal a small difference.
Does this tool send my numbers to a server?
No. The conversion is performed in your browser using JavaScript. The PHP page provides the HTML and page metadata.