Binary fraction converter
Convert a decimal fraction into its binary form.
Try it
Inputs
Result
The result appears here as you type.
About Binary fraction converter
A binary fraction converter turns a decimal number with a fractional part into its binary form. Enter a value such as 0.625 and the tool shows the binary equivalent, 0.101 in that case. It helps students understanding how computers store fractions, and it shows why some decimal fractions, such as 0.1, have endless binary expansions.
Binary fractions work in the same way as decimal fractions, except that each place is a power of two instead of ten. The first place after the point is a half, the second a quarter, the third an eighth, and so on. A number is represented exactly only if its fractional part can be built from those halves, quarters and eighths.
How to use Binary fraction converter
- Enter a decimal number. The whole part and the fractional part are converted separately.
- Read the whole part in binary, which is the usual conversion of an integer.
- Read the fractional digits, which are generated by repeatedly doubling the fraction.
- Note that the converter shows up to twelve fractional digits, and rounds beyond that.
The doubling method
To convert a fraction, double it. If the result is one or more, write a 1 and subtract one. If not, write a 0. Repeat with the remaining fraction until it reaches zero or the required number of digits is found.
For 0.625, doubling gives 1.25, so the first digit is 1 and the remainder is 0.25. Doubling again gives 0.5, so the second digit is 0. Doubling once more gives exactly 1, so the third digit is 1. The result is 0.101 in binary.
Why most decimals repeat in binary
A fraction terminates in binary only if its denominator, in lowest terms, is a power of two. One tenth has a denominator of ten, which includes the factor five, so its binary form repeats forever. Computers round such numbers, and that rounding causes small errors in arithmetic.
Knowing this helps when you compare floating-point results. A sum that should equal 0.3 may show a tiny error because 0.1 and 0.2 are stored as rounded binary fractions.
Binary fractions are the basis of fixed-point arithmetic, used in some digital signal processors and in graphics code. In those systems the position of the binary point is fixed, and every number is stored as a whole number scaled by a power of two.
A useful habit is to check a binary result by converting it back to decimal. Add the place values for each set digit, such as one half plus one eighth for 0.101 in binary, and confirm the total matches the original number.
Frequently asked questions
Why does 0.1 never end in binary?
One tenth needs a factor of five in its denominator, and only powers of two terminate in binary. The pattern 0.000110011... repeats.
Can I convert a negative number?
This tool works with positive numbers. For a negative value, convert the absolute value and add the minus sign.
Why is the output rounded?
A repeating binary fraction has no end, so the converter stops after twelve digits, which is enough for most teaching and checking.
Related tools
Tools that pair well with this one.