No Login Data Private Local Save

Decimal to IEEE 754 Binary - Online Float Representation

7
0
0
0

Decimal to IEEE 754 Binary Converter

Convert any decimal number to its IEEE 754 single (32-bit) and double (64-bit) precision floating-point representation.

32-bit Single Precision (float)
Sign (1 bit) Exponent (8 bits) Mantissa (23 bits)
Hex:
64-bit Double Precision (double)
Sign (1 bit) Exponent (11 bits) Mantissa (52 bits)
Hex:

Frequently Asked Questions

What is IEEE 754 floating-point format?
IEEE 754 is the international standard for representing real numbers in binary form within computer systems. It defines how floating-point numbers are stored and calculated, using three components: a sign bit (indicating positive or negative), an exponent (scaling the number by powers of 2), and a mantissa/significand (the actual significant digits). This standard ensures consistent floating-point behavior across different hardware and programming languages.
What's the difference between single (32-bit) and double (64-bit) precision?
Single precision uses 32 bits total: 1 sign bit, 8 exponent bits (bias 127), and 23 mantissa bits — providing about 7 significant decimal digits. Double precision uses 64 bits total: 1 sign bit, 11 exponent bits (bias 1023), and 52 mantissa bits — providing about 15–17 significant decimal digits. Double precision offers much greater accuracy and a vastly larger range, making it the default for most scientific computing.
Why does 0.1 + 0.2 ≠ 0.3 in most programming languages?
This is the most famous floating-point precision issue! The decimal number 0.1 cannot be represented exactly in binary — its binary expansion is an infinite repeating fraction (0.0001100110011...₂). When truncated to 23 or 52 mantissa bits, a tiny rounding error occurs. Similarly, 0.2 has the same issue. When these slightly-imperfect representations are added, the accumulated error becomes visible: 0.1 + 0.2 ≈ 0.30000000000000004. This is not a bug, but a fundamental property of binary floating-point representation.
What are NaN, Infinity, and denormalized numbers?
Infinity occurs when all exponent bits are 1 and all mantissa bits are 0 — representing overflow (too large) or division by zero. NaN (Not a Number) has all exponent bits set to 1 but a non-zero mantissa — used for undefined results like 0/0 or √(−1). Denormalized (subnormal) numbers have all exponent bits set to 0 but a non-zero mantissa — they fill the gap between zero and the smallest normalized number, allowing gradual underflow. They sacrifice precision for an extended range near zero.
What is the "hidden bit" or "implicit leading 1"?
In normalized IEEE 754 numbers, the mantissa's most significant bit is always 1 (because the number is normalized to the form 1.xxx × 2^exp). Since it's always 1, IEEE 754 doesn't store it explicitly — saving one precious bit of precision. So a 23-bit stored mantissa actually represents 24 bits of precision. For denormalized numbers, this implicit bit is 0, which is how the format achieves gradual underflow toward zero.
What is exponent bias and why is it used?
The exponent bias (127 for single precision, 1023 for double precision) is a fixed offset added to the actual exponent before storage. This allows the exponent to be stored as an unsigned integer while still representing both positive and negative exponents. For example, in single precision, a stored exponent of 0 represents 2−127 (used for zero and denormalized numbers), while 127 represents 20 = 1, and 254 represents 2127. The values 0 and 255 are reserved for special cases.
What is the range of IEEE 754 single and double precision?
Single precision (32-bit): Approximately ±1.18 × 10−38 to ±3.4 × 1038 for normalized numbers, with denormalized numbers going as low as ±1.4 × 10−45.
Double precision (64-bit): Approximately ±2.23 × 10−308 to ±1.80 × 10308 for normalized numbers, with denormalized numbers going as low as ±4.94 × 10−324.