0
32
bits
8
bits
23
bits
127
3.14
0
1
—
—
—
3.402823e+38
1.175494e-38
1.401298e-45
0.000000119209
0
32
bits
8
bits
23
bits
127
3.14
0
1
—
—
—
3.402823e+38
1.175494e-38
1.401298e-45
0.000000119209
The Floating-Point IEEE 754 Converter is an essential tool for programmers, computer scientists, and engineers who need to understand how decimal numbers are represented in binary floating-point format. The IEEE 754 standard, first published in 1985 and revised in 2008 and 2019, defines the most widely used representation for real numbers in modern computing. Nearly every CPU, GPU, and programming language implements arithmetic following this standard.
Understanding IEEE 754 is critical because floating-point representation introduces inherent limitations that can lead to subtle bugs in software. The classic example is that 0.1 + 0.2 does not equal 0.3 in floating-point arithmetic — a fact that has caused countless bugs in financial software, scientific simulations, and everyday applications. By visualizing how a decimal number maps to its sign bit, exponent, and mantissa, developers gain intuition about precision limits, rounding behavior, and the distribution of representable numbers on the real number line.
The IEEE 754 standard encodes a floating-point number using three components: a sign bit (0 for positive, 1 for negative), a biased exponent that determines the magnitude, and a mantissa (or significand) that stores the fractional precision bits. In single precision (32-bit), the format allocates 1 sign bit, 8 exponent bits, and 23 mantissa bits. In double precision (64-bit), it uses 1 sign bit, 11 exponent bits, and 52 mantissa bits. The exponent is stored with a bias (127 for single, 1023 for double) so that both positive and negative exponents can be represented as unsigned integers.
The value of a normal IEEE 754 number is computed as: $$(-1)^{s} \times 2^{e - \text{bias}} \times (1 + f)$$ where \(s\) is the sign bit, \(e\) is the stored (biased) exponent, and \(f\) is the fractional part of the mantissa. The leading 1 in the significand (the "implicit bit") is not stored, effectively giving an extra bit of precision for free.
Special values in IEEE 754 include: positive and negative zero (sign bit differs, exponent and mantissa all zeros), positive and negative infinity (exponent all ones, mantissa all zeros), and NaN (Not a Number, exponent all ones, mantissa non-zero). Subnormal (denormalized) numbers use an exponent of all zeros with a non-zero mantissa, allowing representation of values smaller than the minimum normal number at the cost of reduced precision.
This converter helps you explore these concepts interactively. Enter any decimal number and instantly see the sign bit, biased and unbiased exponents, the number of mantissa and exponent bits, and the range limits of the chosen precision format. Whether you are debugging numerical code, studying computer architecture, or preparing for technical interviews, this tool provides immediate insight into the binary representation that underlies all floating-point computation.
The IEEE 754 floating-point representation decomposes a real number into three binary fields:
Step 1: Determine the Sign Bit
$$s = \begin{cases} 0 & \text{if } x \geq 0 \\ 1 & \text{if } x < 0 \end{cases}$$
Step 2: Compute the Unbiased Exponent
For a non-zero number, the unbiased exponent is:
$$e_{\text{unbiased}} = \lfloor \log_2(|x|) \rfloor$$
Step 3: Add the Bias
The stored (biased) exponent is:
$$e_{\text{biased}} = e_{\text{unbiased}} + \text{bias}$$
where the bias is \(2^{k-1} - 1\), with \(k\) being the number of exponent bits (8 for single precision, 11 for double).
$$\text{bias}_{32} = 2^{8-1} - 1 = 127$$
$$\text{bias}_{64} = 2^{11-1} - 1 = 1023$$
Step 4: Determine the Mantissa
The mantissa encodes the fractional part after normalizing the number to the form \(1.f \times 2^{e}\). The number of mantissa bits determines how many fractional digits are stored (23 for single, 52 for double).
Range Limits:
$$\text{Max}_{32} \approx 3.4028 \times 10^{38}, \quad \text{Min Normal}_{32} \approx 1.175 \times 10^{-38}$$
$$\text{Max}_{64} \approx 1.798 \times 10^{308}, \quad \text{Min Normal}_{64} \approx 2.225 \times 10^{-308}$$
The sign bit indicates whether the number is positive (0) or negative (1). The biased exponent is the value actually stored in the exponent field; subtract the bias to get the true power of 2. A biased exponent of 0 indicates a subnormal number or zero, while the maximum value (255 for single, 2047 for double) indicates infinity or NaN. The mantissa bits count tells you how many fractional binary digits of precision are available — more mantissa bits means finer granularity. Single precision gives about 7 decimal digits of precision, while double precision gives about 15-16 decimal digits.
Inputs
Results
3.14 is positive (sign=0). log2(3.14)=1.65, floor=1. Biased exponent = 1+127 = 128.
Inputs
Results
-0.5 is negative (sign=1). log2(0.5)=-1, floor=-1. Biased exponent = -1+1023 = 1022.
IEEE 754 is the international standard for floating-point arithmetic, defining how real numbers are represented in binary. It specifies formats (single, double, extended precision), rounding rules, special values (infinity, NaN), and exception handling. Nearly all modern processors and programming languages implement IEEE 754 arithmetic.
In IEEE 754, 0.1 and 0.2 cannot be represented exactly in binary floating-point because they are repeating fractions in base 2. The stored approximations, when added, produce a result like 0.30000000000000004. This is a fundamental limitation of binary representation, not a bug in any particular language.
Single precision uses 32 bits (1 sign, 8 exponent, 23 mantissa) and provides about 7 decimal digits of precision with a range up to ~3.4e38. Double precision uses 64 bits (1 sign, 11 exponent, 52 mantissa) and provides about 15-16 decimal digits of precision with a range up to ~1.8e308.
The exponent bias is a fixed offset added to the actual exponent so that negative exponents can be stored as positive unsigned integers. For single precision the bias is 127, so exponents from -126 to +127 are stored as 1 to 254. For double precision the bias is 1023.
Subnormal numbers have a biased exponent of zero and a non-zero mantissa. They fill the gap between zero and the smallest normal number, allowing gradual underflow. Subnormals have reduced precision because the implicit leading 1 is replaced by 0, so fewer significant bits are available.
NaN (Not a Number) is a special value produced by undefined operations like 0/0, sqrt(-1), or infinity minus infinity. NaN has an exponent field of all 1s and a non-zero mantissa. Importantly, NaN is not equal to anything, including itself (NaN != NaN is always true).
A 32-bit float has 23 mantissa bits plus the implicit leading 1, giving 24 binary digits of precision. This translates to approximately 7.22 significant decimal digits. Any decimal number with more than 7 significant digits may not round-trip perfectly through float32.
In normalized IEEE 754 numbers, the significand is stored as 1.mantissa where the leading 1 is implicit — it is not actually stored in the bit field. This gives one extra bit of precision for free. Only subnormal numbers have an implicit leading 0 instead of 1.
Use double (64-bit) as the default for most applications, as it provides sufficient precision for financial, scientific, and engineering calculations. Use float (32-bit) when memory or bandwidth is critical, such as in GPU shaders, large arrays of sensor data, or mobile applications where the reduced precision is acceptable.
Overflow occurs when a result exceeds the maximum representable finite value; IEEE 754 rounds it to positive or negative infinity. Underflow occurs when a result is smaller than the minimum normal value; gradual underflow uses subnormal numbers to represent it with reduced precision before reaching zero.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
Hexadecimal Calculator
Programming & Developer Calculators
Programmer Calculator (Hex/Oct/Bin/Dec)
Programming & Developer Calculators
Twos Complement Calculator
Programming & Developer Calculators
Ones Complement Calculator
Programming & Developer Calculators
Fractional Bits Converter
Programming & Developer Calculators
Hamming Code Calculator
Programming & Developer Calculators