Repeating Decimal Calculator & Remainder Cycle

Use parentheses to enter a decimal's repeating block, or start from a whole numerator and denominator. See the exact fraction, nonrepeating prefix, shortest period, denominator factors and long-division remainder cycle. Jump directly to a later digit without expanding the intervening decimal.

Exact decimal and fraction study

Explore a repeating decimal's remainder cycle

The shortest repeating block has 6 digits.

For example, 0.03(571428) repeats 571428 after the first two fractional digits.

Reduced fraction

1/28

Shortest decimal form

0.03(571428)

2 nonrepeating · 6 repeating

Cancel the common repeating tail

Multiply by two powers of ten that align the same repeating tail. Subtract the resulting expressions.

108x − 102x = 3571428 − (3)

3571425/99999900 = 1/28

Why the digits repeat

28 = 22 × 50 × 7

The larger exponent of 2 and 5 gives 2 nonrepeating fractional digits.

The shortest power that returns 1 modulo 7 is 106.

Follow the remainders

Each point is the remainder after that many fractional digits. A repeated remainder makes the same digits recur.

Long division remainder path8 digits shown. Remainders in order 1, 10, 16, 20, 4, 12, 8, 24, 16. The path returns to the cycle start.08Fractional digits processed

The amber guide joins the first and second visits to remainder 16.

Inspect any fractional digit

Jump to a place or follow the remainder from one digit to the next.

Digit 1 is 0

Nonrepeating prefix

Before
1
Multiply by 10
10
Remainder after
10
Review long division and exact CSV
Exact digits and remainders before termination or repetition
PlaceBeforeTimes 10DigitAfter
1110010
210100316
316160520
42020074
5440112
61212048
7880224
824240816

How to use this calculator

  1. Enter a finite decimal or put the block that repeats continuously in parentheses. To start with a fraction, switch modes and enter its two terms.
  2. Read the reduced fraction, shortest decimal form or leading digits, and the exact prefix and period lengths.
  3. Follow the denominator factorization and remainder plot to see where repetition begins.
  4. Jump to the first or last cycle digit, or enter any available digit position to see its exact division step.
  5. Review or export the long-division ledger, including the end-of-cycle witness when the complete block is too long to display.

The Formula

The mathematical logic powering this calculation is:

Write the endlessly repeating digits in parentheses, such as 0.03(571428). If there are p fractional digits before the repeating block and q digits in the block, multiply the number x by 10ᵖ and 10ᵖ⁺ᑫ. The fractional tails now match. Subtract to get (10ᵖ⁺ᑫ − 10ᵖ)x equal to the signed difference of the integer parts before those tails. Divide and reduce with the greatest common divisor. A finite input uses its ordinary decimal place-value denominator. Signs apply to the whole number.

For a reduced denominator d = 2ᵃ × 5ᵇ × m with m coprime to 10, the nonrepeating fractional prefix has max(a,b) digits. When m = 1 the decimal terminates. Otherwise the shortest repeating period is the least positive k for which 10ᵏ leaves remainder 1 modulo m. For fraction inputs Euler's totient of m supplies a multiple of the period. For explicit decimal repeats, the entered block length supplies a multiple. Divide that starting exponent by prime factors whenever the smaller exponent still returns remainder 1. This keeps reducing to the shortest period. The canonical result uses zero remainders to represent terminating values, including inputs that have a trailing sequence of nines.

Long division of the absolute numerator gives the initial remainder r = |numerator| mod d. For each digit, multiply its prior remainder by 10. The quotient digit is the integer part of 10r/d, and the next remainder is 10r mod d. Returning to a prior remainder repeats all following digits. At digit position j, the preceding remainder is the initial remainder times 10ʲ⁻¹ modulo d. Repeated squaring finds that power directly without generating all earlier digits.

The decimal form shows up to 72 leading fractional digits. Shorter cycles show their complete shortest block in parentheses. For longer cycles the first 72 digits have an ellipsis and the exact period and cycle-end remainder stay visible. The plot shows up to 24 fractional steps. The CSV includes the 72-place ledger, the exact cycle-end witness when applicable and the selected place.

In decimal mode, the integer and fractional prefix each allow up to 24 digits, and the repeating block allows up to 72 digits. In fraction mode, the numerator allows up to 24 digits and the positive denominator ranges from 1 through 100,000,000. Inspect positions from 1 through 100,000,000. Arithmetic, reduction and cycle lengths use exact integers. The plot scales remainder magnitudes for display.

Worked Example

If you input:

  • Decimal: 0.03(571428)

Result:

The fraction is 1/28. Two nonrepeating fractional digits, 03, precede the six-digit block 571428. The long division remainder is 16 after digit 2 and again after digit 8.

Frequently Asked Questions

Why does 0.(9) become 1?

Subtract 0.(9) from 9.(9). The repeating nines cancel, leaving 9 times the original value equal to 9. The reduced fraction is therefore 1.

Why can an entered block get shorter?

A block can contain repeated copies of a smaller block. For example, 0.(1212) and 0.(12) define the same value. The shortest denominator cycle chooses the smaller block.

Why do some decimals have digits before the repeat starts?

The factors of 2 and 5 in the reduced denominator cause the prefix. When the remainder reaches the part governed by the denominator coprime to 10, the cycle begins.

What counts as the first digit position?

Position 1 is the tenths digit, position 2 is hundredths, and so on. A leading fractional zero still counts as a digit.

How can I verify that a long cycle really closes?

Check the remainder before the first cycle digit and the remainder after the last cycle digit. They must agree. The closing division step is available in the worksheet even when the leading preview stops earlier.

How does a negative input affect the remainders?

The sign belongs to the resulting value. Long division of the magnitude provides the same fractional digits and positive remainders.

Similar Calculators