Converting integers to binary is easy; what about converting the decimal part? Learn how to do it with our binary fraction converter. Get a better understanding of your computer with us. Here, we will teach you:
- What a binary fraction is.
- Where we use binary fractions.
- The limitations of a computer and the effect on rounding.
- How to convert from decimal fraction to binary fraction and vice-versa.
- How to use our binary fraction converter — it's simple, trust us!
Binary representation
Computers think in terms of ones and zeros — that's binary code, and it is everywhere. Peek behind this converter, and you'll see a lot of those numbers!
Converting integer numbers from base 10 (decimal) to base 2 (binary) is easy and doesn't introduce errors. The same holds when you consider a number written in positional notation (when you specify the position of a digit in a number). We can't say the same of decimal numbers as you would write them on a sheet of paper, like 0.42 and 0.33333333...
💡 If you want to learn how to convert integers from base 10 to base 2, go to our decimal to binary calculator! Are you asking for other bases? We got you: try the binary to hexadecimal converter or the binary to octal converter.
What is a binary fraction?
Take the decimal part of a non-integer number. That is a proper fraction — its value is smaller than one. When the denominator is a power of ten (10, 100, 1000, …), we talk of decimal fractions:
137 / 1000 = 0.137
Representing such values in base 2 brings us the binary fractions! Instead of powers of ten in the denominator, the digits after the "binary point" represent negative powers of two: 1/2, 1/4, 1/8, 1/16, and so on.
How to convert fractions to binary
Converting a decimal fraction to binary is not that hard. Take any decimal fraction: we chose 0.2912. Make sure that the integer part is 0. Now, multiply it by two, and see what happens — the integer part of the result becomes the next binary digit, and you carry the remaining fraction forward:
0.2912 × 2 = 0.5824 → 0 0.5824 × 2 = 1.1648 → 1 (keep 0.1648) 0.1648 × 2 = 0.3296 → 0 0.3296 × 2 = 0.6592 → 0 0.6592 × 2 = 1.3184 → 1 (keep 0.3184) ...
Reading the resulting bits from top to bottom gives the binary fraction: 0.2912₁₀ ≈ 0.01001…₂. You repeat the process until the remaining fraction becomes zero (an exact conversion) or until you reach the number of bits you want (an approximate conversion).
For the integer part, use the usual repeated-division-by-2 method, then join the two parts with a binary point. For example, 10.625₁₀ = 1010.101₂.
The conversion from binary fraction to decimal fraction
Going the other way is just a weighted sum. Each digit to the right of the binary point is multiplied by a negative power of two and added up:
0.101₂ = 1×2⁻¹ + 0×2⁻² + 1×2⁻³
= 0.5 + 0 + 0.125
= 0.625₁₀
Digits to the left of the point use positive powers of two, exactly like whole binary numbers. Our converter shows every term of this positional expansion, plus the exact fraction of the form numerator / 2ᵏ.
The limitations of binary fractions
Here is the catch: many simple decimal fractions have no finite binary representation. The classic example is 0.1₁₀, which becomes the repeating binary fraction 0.0001100110011…₂. Since a computer stores only a limited number of bits, it must truncate or round the value. That is why 0.1 + 0.2 famously doesn't equal exactly 0.3 in floating-point arithmetic — the tiny rounding errors add up. Our converter reports whether a conversion is exact and, when it isn't, shows the rounding error introduced by your chosen precision.
How to use our binary fraction converter
- Choose the direction. Convert a decimal number to binary, or a binary fraction to decimal.
- Enter your number. For decimal → binary, type a value such as
5.2912and pick how many fractional bits of precision you want (1–32). For binary → decimal, type a value such as101.01001(only 0s, 1s, and a single point). - Click Convert. You'll get the result, a step-by-step table (multiply-by-two for one direction, positional expansion for the other), whether the result is exact, and the rounding error if it isn't.
Beyond 0s and 1s
Binary fractions are the foundation of how computers store real numbers, but they aren't the only game in town. Fixed-point and floating-point formats (like IEEE 754) build on these ideas to pack a huge range of values into a fixed number of bits. Understanding binary fractions is the first step to understanding why your programs sometimes produce those surprising 0.30000000000000004 results.
FAQs
How do I convert 0.5 to binary?
Multiply by two: 0.5 × 2 = 1.0, giving the bit 1 and a remainder of 0. The conversion terminates, so 0.5₁₀ = 0.1₂ exactly.
Why can't 0.1 be stored exactly in binary?
Because 0.1 in binary is a repeating fraction (0.00011001100…₂). With a finite number of bits, the computer must round it, which introduces a small error.
What is the binary point?
It's the base-2 analogue of the decimal point. Digits to its left are positive powers of two; digits to its right are negative powers of two (1/2, 1/4, 1/8, …).
How many bits of precision should I use?
It depends on how much accuracy you need. More bits mean a smaller rounding error. Our tool lets you pick from 1 to 32 fractional bits and reports the resulting error so you can decide.