Floating-Point Converter (IEEE 754)

Quick answer

The floating-point converter turns a decimal number into its IEEE 754 single (32-bit) and double (64-bit) precision bits and hexadecimal, shows the exact value stored and the rounding error, and decodes a bit pattern or hex value back into a number.

Examples: 27.75, -0.1, 6.02e23, inf, nan

Value
0.1 (single) · 0.1 (double)
Single precision bits (S E F)
0 01111011 10011001100110011001101
Single precision hex
0x3DCCCCCD
Exact value stored in single precision
0.100000001490116119384765625
Single precision conversion error
1.490116 × 10^-9 (relative 1.490 × 10^-8)
Double precision bits (S E F)
0 01111111011 1001100110011001100110011001100110011001100110011010
Double precision hex
0x3FB999999999999A
Exact value stored in double precision
0.1000000000000000055511151231257827021181583404541015625
Double precision conversion error
5.551115 × 10^-18 (relative 5.551 × 10^-17)
Breakdown
Format Sign Exponent (biased) Exp. (unbiased) Significand Class ────────────────────────────────────────────────────────────────────────────────────────────── Single (32-bit) 0 01111011 = 123 -4 1.600000023842 Normal number Double (64-bit) 0 01111111011 = 1019 -4 1.6 Normal number

Computers store real numbers in binary scientific notation defined by the IEEE 754 standard. A number is split into three fields: a sign bit, an exponent stored with a bias, and a fraction (mantissa) holding the digits after the leading 1. Single precision (float32) uses 1 + 8 + 23 bits and keeps about 7 significant decimal digits; double precision (float64) uses 1 + 11 + 52 bits and keeps about 15–16 digits.

Because only a fixed number of binary digits fit, most decimal fractions cannot be stored exactly. 0.1 in binary is 0.000110011001100… repeating forever, so the computer stores the nearest representable value: 0.100000001490116… as a float and 0.1000000000000000055511… as a double. That tiny error is why 0.1 + 0.2 does not equal 0.3 in most programming languages, and why money should be counted in whole cents.

The standard also reserves special patterns. An exponent of all zeros gives zero (with a sign!) and subnormal numbers that fill the gap down to zero; an exponent of all ones gives infinity or NaN (“not a number”). This converter shows every field, the exact decimal value actually stored and the conversion error, and works both ways – from a number to bits and from bits or hex back to a number.

How to use the Floating-Point Converter

  1. I want to convert
  2. Decimal number — Examples: 27.75, -0.1, 6.02e23, inf, nan
  3. Precision
  4. Input method
  5. Bit string (32 or 64 bits)
  6. Sign bit (S)
  7. Exponent bits (E) – 8 or 11 bits
  8. Fraction bits (F) — Missing trailing bits are filled with zeros.
  9. Hexadecimal (8 or 16 digits)

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

To encode, the number is rounded to the nearest representable value in each format and its bits are read out; the exact stored value is expanded digit by digit and compared with your input. To decode, the sign, exponent and fraction fields are separated and evaluated with the formula for normal, subnormal or special values.

Worked example

27.75 in binary is 11011.11 = 1.101111 × 2⁴. The sign bit is 0, the exponent is 4 + 127 = 131 = 10000011₂ and the fraction is 10111100…0. The single precision pattern is 0 10000011 10111100000000000000000 = 0x41DE0000, and it stores 27.75 exactly. Decoding works backwards: (−1)⁰ × 2^(131 − 127) × 1.734375 = 27.75. By contrast 0.1 becomes 0x3DCCCCCD, which stores 0.100000001490116119384765625 – an error of about 1.49 × 10⁻⁹.

Format summary

Property Single (float32) Double (float64)
Sign / exponent / fraction bits 1 / 8 / 23 1 / 11 / 52
Exponent bias 127 1023
Decimal digits ≈ 7 ≈ 15–16
Largest value 3.40 × 10³⁸ 1.80 × 10³⁰⁸
Smallest normal 1.18 × 10⁻³⁸ 2.23 × 10⁻³⁰⁸
Machine epsilon 1.19 × 10⁻⁷ 2.22 × 10⁻¹⁶

Formula

Normal: value = (−1)^S × 2^(E − bias) × 1.F · Subnormal (E = 0): (−1)^S × 2¹ − bias) × 0.F · bias = 127 (single), 1023 (double) · E all ones: ±∞ (F = 0) or NaN

Worked example

Inputs — I want to convert: Number → floating point (bits and hex); Decimal number: 0.1.
Results — Value = 0.1 (single) · 0.1 (double); Single precision bits (S E F) = 0 01111011 10011001100110011001101; Single precision hex = 0x3DCCCCCD; Exact value stored in single precision = 0.100000001490116119384765625; Single precision conversion error = 1.490116 × 10^-9 (relative 1.490 × 10^-8); Double precision bits (S E F) = 0 01111111011 1001100110011001100110011001100110011001100110011010.

Key terms

Sign bit (S)
0 for positive, 1 for negative numbers.
Exponent (E)
Power of two, stored with a bias added.
Fraction / mantissa (F)
Bits after the binary point of the significand 1.F.
Machine epsilon
Gap between 1 and the next float: 2⁻²³ ≈ 1.19 × 10⁻⁷ (single), 2⁻⁵² ≈ 2.22 × 10⁻¹⁶ (double).

Frequently asked questions

Why is 0.1 + 0.2 not equal to 0.3?

Neither 0.1 nor 0.2 is exact in binary; their stored values add up to 0.30000000000000004 in double precision.

How many digits does a float hold?

Single precision about 7 significant decimal digits, double precision about 15–16.

What is the bias?

A constant added to the exponent so it can be stored as an unsigned number: 127 for single, 1023 for double.

What is the largest float?

About 3.4028235 × 10³⁸ in single precision and 1.7976931 × 10³⁰⁸ in double precision.

What are subnormal numbers?

Values with an all-zero exponent that fill the gap near zero without the hidden leading 1, down to 1.4 × 10⁻⁴⁵ (single).

Why is there a −0?

The sign bit is separate, so zero can be positive or negative; they compare equal but behave differently in 1 ÷ x.

What does NaN mean?

"Not a number" – the result of undefined operations like 0 ÷ 0 or √−1; any exponent of all ones with a non-zero fraction.

Sources

  1. IEEE 754-2019 – Standard for Floating-Point Arithmetic
  2. Goldberg, D. – What Every Computer Scientist Should Know About Floating-Point Arithmetic

Cite this calculator

Speedy Calculator. (2026). Floating-Point Converter (IEEE 754). Speedy Calculator. https://speedycalculator.com/calculators/other/floating-point/