Skip to content

IEEE 754 Floating Point Converter

Enter a decimal number to see how a computer stores it as a 32-bit float and a 64-bit double, including the value actually held after rounding.

Result

Single precision (hex)
0x3DCCCCCD
Double precision (hex)
0x3FB999999999999A
Single precision bits (1 sign, 8 exponent, 23 mantissa)
0 01111011 10011001100110011001101
Double precision bits (1 sign, 11 exponent, 52 mantissa)
0 01111111011 1001100110011001100110011001100110011001100110011010
Value stored as a 32-bit float
0.10000000149011612
Value stored as a 64-bit double
0.1
Float sign bit
0 (positive)
Float exponent
01111011 = 123, so 2^-4
Double exponent
01111111011 = 1019, so 2^-4

Formula

  • Value = (−1)^sign × 1.mantissa × 2^(exponent − bias)
  • Single precision: 1 sign bit, 8 exponent bits (bias 127), 23 mantissa bits
  • Double precision: 1 sign bit, 11 exponent bits (bias 1023), 52 mantissa bits

How the IEEE 754 Floating Point Converter works

IEEE 754 is the standard nearly every computer uses for real numbers. A value is stored in binary scientific notation: a sign, a power of two and a fraction called the mantissa or significand.

Most decimal fractions cannot be written exactly in binary, just as one third cannot be written exactly in decimal. The stored value is the nearest representable number, which is why 0.1 + 0.2 does not equal 0.3 exactly in most programming languages.

Worked example

0.1 as a 32-bit float is 0x3DCCCCCD. The sign is 0, the exponent field is 123, meaning 2^−4, and the value actually stored is 0.10000000149011612.

Frequently asked questions

Why is 0.1 + 0.2 not equal to 0.3?

Neither 0.1 nor 0.2 has an exact binary representation. Each is rounded to the nearest double, and the sum of those rounded values is 0.30000000000000004.

How many decimal digits can a float hold?

A 32-bit float holds about 7 significant decimal digits and a 64-bit double about 15 to 17.

Related calculators

All text, code and network calculators · All calculators

Related unit converters

Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.

☕ Like this tool?

Buy me a coffee to support development

☕ Support UnitGenie

If this tool has been helpful, consider buying me a coffee to support development and keep it free for everyone!