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.
Explore a repeating decimal's remainder cycle
Convert a repeating decimal or fraction and find the exact first digit and length of its cycle.
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.
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
| Place | Before | Times 10 | Digit | After |
|---|---|---|---|---|
| 1 | 1 | 10 | 0 | 10 |
| 2 | 10 | 100 | 3 | 16 |
| 3 | 16 | 160 | 5 | 20 |
| 4 | 20 | 200 | 7 | 4 |
| 5 | 4 | 40 | 1 | 12 |
| 6 | 12 | 120 | 4 | 8 |
| 7 | 8 | 80 | 2 | 24 |
| 8 | 24 | 240 | 8 | 16 |
How to use this calculator
- 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.
- Read the reduced fraction, shortest decimal form or leading digits, and the exact prefix and period lengths.
- Follow the denominator factorization and remainder plot to see where repetition begins.
- Jump to the first or last cycle digit, or enter any available digit position to see its exact division step.
- 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
Rational Approximation & Denominator Budget Calculator
Find the closest fraction under a denominator cap, compare exact lower and upper choices, and calculate the smallest denominator that meets your error tolerance.
Prime Factorization Calculator
Find the prime factors of any whole number and express it as a product of prime numbers.
Fraction Calculator
Add, subtract, multiply, and divide fractions with step-by-step simplified results.
Least Common Denominator & Fraction Scaling Calculator
Find the least common denominator for up to 12 fractions. Compare entered and reduced denominators, see the prime powers that set the minimum, and scale every fraction exactly.
GCF Calculator
Find the greatest common factor (GCF) of two or more integers.
Binary to Hex Calculator & Fixed-Point Word Inspector
Convert binary to hexadecimal, decode endian byte order and compare integer and fixed-point values. Encode decimals and inspect bit weights.
RSA Encryption Calculator & Modular Exponent Trace
Work through an RSA integer example with small primes. See the exact key inverse, ciphertext, decrypted integer, and each square-and-multiply step.
