Saved

Press the star next to a tool's name to save it.

All my tools

Binary Fraction Calculator

Use this binary fraction calculator to convert a decimal number or fraction to binary, with repeating digits in brackets, and a binary number with a point back to decimal.

Restored your last values ·

Enter a decimal number, or a fraction, to get its binary form, with repeating digits in brackets. Or enter a binary number with a point to get its decimal value.

Everything is worked out in your browser. Nothing you type is sent anywhere.

–

–

Choose what you want and enter a number, then press Convert.

A binary fraction calculator converts a decimal fraction to binary, and a binary number with a point back to decimal. It uses the doubling method for the fractional part, shows repeating digits in brackets, and explains why a simple decimal such as 0.1 never ends in binary.

How to use the binary fraction calculator

  1. Choose decimal to binary or binary to decimal.
  2. Enter the number.
  3. Press Convert.

Place values

Non-integers can be written in binary by using negative powers of two, set off from the whole part by a radix point [1]. The first digit after the point is worth one half, the second one quarter, the third one eighth, and so on. The page's example is 11.01 in binary, which is 1 × 2 + 1 × 1 + 0 × 1/2 + 1 × 1/4 = 3.25 in decimal [1]. Enter it in the binary-to-decimal mode to see this.

The doubling method

To convert a decimal fraction, repeatedly double the number, record a 1 if the result is at least 1 and a 0 if not, and then throw away the integer part [1]. The recorded digits are the binary digits after the point, in order. For 0.625: double to 1.25, record 1, keep 0.25; double to 0.5, record 0; double to 1.0, record 1. The result is 0.101. The calculator does this with exact whole-number arithmetic, so there is no rounding.

Whole part

The whole part is converted separately. The page describes the division by two method for integers, in which the remainder at each step is a binary digit and the first remainder is the least significant bit [1]. So 13 is 1101. Putting the parts together, 13.625 is 1101.101 in binary. The calculator does both parts at once.

When the fraction ends

A fraction terminates in binary only if the denominator is a power of 2 [1]. All dyadic rational numbers, of the form p over 2 to the power a, have a terminating binary numeral [1]. So 0.5, 0.25, 0.75 and 0.625 end, because they are 1/2, 1/4, 3/4 and 5/8. Other rational numbers have a binary representation that recurs, instead of terminating [1].

Repeating digits

The page gives 1/3 as an example: its binary expansion is .010101…, in which the zeros and ones alternate forever [1]. The calculator writes it as 0.(01), with the repeating block in brackets. It finds the repeat by watching for a remainder that has been seen before, which is exact and not a guess. The page also gives 1/12 as a repeating expansion with a longer period [1].

Why 0.1 is special

The decimal fraction 1/10 does not have a finite binary representation, because 10 has the prime factors 2 and 5 [1]. Doubling 0.1 repeatedly gives 0.0001100110011…, a repeating binary fraction, and the page notes that terminating decimal fractions can have repeating expansions in binary [1]. The calculator shows 0.1 as 0.0(0011): a 0, then the block 0011 over and over.

Floating point

Because 1/10 has no finite binary form, the page notes that in binary floating-point arithmetic ten times one tenth does not precisely equal 1 [1]. Programs keep only a limited number of binary digits, so 0.1 is stored as a nearby number. This is the reason that 0.1 + 0.2 may not equal 0.3 exactly in many programming languages. The calculator shows the exact repeating pattern so that you can see what is being cut off.

Irrational numbers

Binary numerals that neither terminate nor recur represent irrational numbers [1]. The page gives the square root of 2 as an example, written 1.0110101000001001111001100110011111110… in binary [1]. This calculator accepts fractions and decimals, which are rational, so its answers either end or repeat. For an irrational number, a decimal approximation gives a long, ending approximation in binary.

Using the calculator

Type a decimal such as 13.625, a fraction such as 1/3, or a binary number such as 1.1. Pick the mode and press the button. The working line explains how the answer was reached. If the expansion is very long, the calculator cuts it off after 64 digits, and puts an ellipsis after the result. For binary input, up to 52 digits after the point are accepted.

Worked conversions

To convert 0.3125, double it: 0.625 gives 0, 1.25 gives 1 with 0.25 left, 0.5 gives 0 and 1.0 gives 1, so the result is 0.0101. To convert 2.75, write 2 as 10 and double 0.75: 1.5 gives 1 with 0.5 left, and 1.0 gives 1, so the result is 10.11. To convert back, 0.0101 is 0 + 1/4 + 0 + 1/16, which is 0.3125. These are our own examples of the method on the page.

Checking a repeating block

For a repeating fraction such as 1/3, check by summing the series. The block 01 repeated is 1/4 + 1/16 + 1/64 + and so on, which adds up to one third. Every repeating binary fraction is a rational number, and every rational number with a denominator that is not a power of 2 repeats. This is why the calculator can always find the repeat by watching for a remainder that has occurred before.

Binary in computing

Computers store numbers in binary, so every decimal fraction that they handle is turned into a binary fraction with a limited number of digits. A standard double-precision number keeps 52 binary digits after the leading one. That is why the calculator accepts up to 52 digits after the point: it is the same number of digits that such a number has, and larger inputs would exceed what the machine can hold exactly.

Common mistakes

  • Rounding 0.1 in the head. It never ends in binary.
  • Forgetting the repeating block. The brackets show it.
  • Mixing up the modes. Decimal to binary and binary to decimal are separate.
  • Entering digits other than 0 and 1. A binary number has only those digits.

What next

Use this often? Add Binary Fract to your Home screen.

Frequently asked questions

What is a binary fraction calculator?

A tool that converts fractions between decimal and binary.

How do I convert a decimal fraction to binary?

Double it repeatedly, record 1 when the result is at least 1, and discard the integer part.

Why does 0.1 repeat in binary?

Because 10 has the prime factor 5, so 1/10 is not a dyadic fraction. It is 0.0(0011) in binary.

When does a binary fraction end?

When the denominator, in lowest terms, is a power of 2.

What is 11.01 in decimal?

3.25.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools