Free Binary Fraction Converter
0.37510 = 0.0112
0.0112 = 0.37510
Enter a value to convert
Computers operate exclusively with bits (0 and 1). While converting an integer from decimal to binary is trivial, the fractional part demands a different treatment. The binary fraction converter (a complete decimal to binary fraction converter and binary to decimal fraction converter in one) not only performs these conversions but also reveals why many decimal fractions cannot be stored exactly in a computer's finite memory.
What Is a Binary Fraction?
Just as a decimal fraction represents a number between 0 and 1 using negative powers of ten, a binary fraction uses negative powers of two. The binary point separates the whole part from the fractional bits. For instance, means:
The binary fraction calculator uses this principle to return instant results in either direction.
Converting a Decimal Fraction to Binary (Fraction to Binary)
To obtain the binary representation of a fractional decimal number, apply the following iterative process:
- Multiply the current fractional part by 2.
- The resulting integer part (0 or 1) becomes the next binary digit.
- Discard the integer part and continue with the new fractional part.
- Stop when the fractional part becomes 0 or when you have collected enough bits (the tool lets you specify the number).
Example: Convert to binary.
- → digit 0, remainder
- → digit 1, remainder
- → digit 0, remainder
- → digit 0, remainder
- → digit 1, remainder
… and so on.
The binary fraction becomes . This sequence continues indefinitely unless the decimal fraction happens to have a denominator that is a power of two.
The decimal to binary fraction converter automates these steps; you only need to enter the fractional value and pick the desired number of bits. The result is truncated — not rounded — to that number of places.
Converting Binary to Decimal (Binary Fraction to Decimal)
To read a binary fraction in decimal, sum the contributions of each 1 bit according to its position. The left‑most bit after the point is worth , the next , and so on.
Example: Convert to decimal.
The binary to decimal fraction converter processes any binary fraction you enter and shows its decimal equivalent immediately.
When Is a Binary Fraction Exact?
A finite binary fraction exists only when the denominator of the original fraction (in lowest terms) is a power of two. If the denominator has any prime factor other than 2, the binary representation is an infinitely repeating sequence. For instance:
- Exact: , , .
- Inexact (repeating): , , .
When a computer stores such a repeating binary fraction, it truncates the expansion after a fixed number of bits (e.g., 23 bits for single‑precision, 52 bits for double‑precision). The resulting value is slightly less than the true decimal fraction, introducing a small error.
For , the 8‑bit truncation gives , an error of . With 23 bits the error drops to — very tiny but still nonzero. This built‑in limitation accounts for many “floating‑point” surprises in software.
How to Use the Binary Fraction Converter
The tool has two main modes:
- Decimal to Binary: Input any decimal fraction (e.g., 0.625) and choose how many fractional bits to output. The fraction to binary converter returns the binary equivalent, truncated to that length.
- Binary to Decimal: Provide a binary fraction (e.g., 0.1010) and the tool displays its decimal value.
You can adjust the number of bits via a custom field; the default values are restored by refreshing the page. Because the converter only truncates, you should be aware that the binary output may not exactly equal the input if the fraction requires an infinite expansion.
Whether you are studying number systems, working with embedded systems, or simply curious about how computers handle fractional numbers, this binary fraction calculator offers a practical, educational way to explore binary fractions.
FAQ
1. How do I use the decimal to binary fraction converter?
Select the Decimal to Binary mode, enter a decimal fraction such as 0.625, choose the desired number of fractional bits, and the tool outputs the binary equivalent truncated to that length.
2. Why can't 0.2 be represented exactly in binary?
In binary, a fraction can only be represented exactly if its denominator (in lowest terms) is a power of two. 0.2 equals 1/5, whose denominator 5 is not a power of two; thus its binary expansion is an infinite repeating sequence, causing a small error when truncated.
3. Does the binary fraction converter round or truncate the result?
The converter truncates the binary fraction to the specified number of bits; it does not round. This means that when the true binary expansion is infinite, the result may be slightly lower than the exact value.
4. How do I manually convert a binary fraction to decimal?
Multiply each digit after the binary point by the corresponding negative power of two (2^{-1}, 2^{-2}, ...) and sum the results. For instance, 0.1101_2 = 1×2^{-1} + 1×2^{-2} + 0×2^{-3} + 1×2^{-4} = 0.8125.
How to Use
- Select the conversion direction (Decimal → Binary or Binary → Decimal).
- Enter a fractional number in the input field (e.g., 0.375 for decimal or 0.011 for binary).
- Choose the number of digits and click Convert to see the converted result.