Repeating Decimal to Fraction Calculator

Enter the whole part, non-repeating digits and repeating block to get the fraction.

How it is calculated

The decimal is split into three parts typed as digit strings: the whole part W, the non-repeating digits (n digits long) and the repeating block (r digits long). The tool builds the fraction directly: denominator = (10r − 1) × 10n and numerator = (nonrepeating+repeating as one number) − (nonrepeating as a number) + W × denominator. It then divides both by their greatest common divisor, so the answer is in lowest terms. Leading zeros count as digits (0012 is four digits). The repeating block is required and, like the other parts, must contain only the digits 0 to 9; the whole part may be left empty for 0 and the non-repeating part may be empty. Negative numbers are not supported, so add the sign yourself afterwards. Very long entries (more than 18 digits across the non-repeating and repeating parts, or a result too large to print exactly) show no result rather than a rounded fraction.

Worked example

Convert 2.3454545… (whole 2, non-repeating 3, repeating 45). Here n = 1 and r = 2, so the denominator is (10² − 1) × 10¹ = 99 × 10 = 990. The number 345 (digits 3 and 45 joined) minus 3 gives 342. Add the whole part: 2 × 990 = 1,980, so the numerator is 342 + 1,980 = 2,322. The fraction 2322/990 divides by 18, giving 129/55. Check: 129 ÷ 55 = 2.3454545…

Try this example →

Common mistakes

  • Putting the repeating digits into the non-repeating box: for 0.1666… the 6 repeats, so 1 is non-repeating and 6 is the block; entering 16 as the block gives 16/99.
  • Writing 0.3333 with four 3s as a repeating block of 3333: that is the same fraction 1/3, but a block of 3 is the shortest and clearest form.
  • Dropping a leading zero in the non-repeating part: 0.0123123… needs non-repeating 0 and repeating 123 (giving 41/3,330); leaving out the zero gives 0.123123…, which is 41/333.
  • Typing a decimal point or a minus sign in a box: each field takes digits only, and anything else shows no result.
  • Expecting 0.999… to stay as a fraction below 1: the tool returns 1/1, since that repeating decimal equals 1 exactly.

About this calculator

Every repeating decimal is secretly a rational number, and there is a standard algebraic trick to recover the exact fraction: let x equal the decimal, multiply x by a power of 10 large enough to shift one full repeating block past the decimal point, subtract the original x, and the repeating parts cancel out completely, leaving a simple equation to solve for x as a fraction. For example, x = 0.1666... gives 10x = 1.666..., and subtracting x from 10x cancels the repeating 6s, leaving 9x = 1.5, so x = 1/6.

This calculator automates that shift-and-subtract method for any decimal made of a whole part, optional non-repeating digits, and a repeating block, returning the exact reduced fraction rather than a rounded approximation. It is a standard topic in algebra courses covering rational numbers, and it matters practically anywhere an exact value is needed instead of a decimal that has been silently truncated — for instance confirming that 0.333... really does equal exactly 1/3 and not just a very close approximation.

Enter the whole part, any non-repeating digits, and the repeating block, and the calculator returns the exact fraction in lowest terms.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators