Given a fraction like \tfrac{7}{40}, you can always do the long division and find out whether its decimal stops or goes on repeating forever. But there is a much faster check — one that takes about five seconds and needs no division at all. Just look at the denominator of the fraction (in lowest terms), break it into prime factors, and read off the answer from the primes. Here is the check and why it works.
The two-primes test
For a fraction \dfrac{p}{q} in lowest terms, the decimal expansion terminates if and only if the denominator q is built only from the primes 2 and 5. Any other prime factor — 3, 7, 11, 13, anything bigger than 5 and not 2 or 5 — forces the decimal to repeat forever.
That is the whole rule. Let me restate it so you can use it on sight:
Reduce the fraction to lowest terms. Factorise the denominator. If the prime factorisation contains only 2s and 5s, the decimal terminates. If the factorisation contains any other prime, the decimal repeats.
Nothing else enters the calculation. You do not need to look at the numerator (once the fraction is in lowest terms). You do not need to carry out long division. You do not need to think about whether the decimal will be short or long — you just need to ask "are the only primes in the denominator 2 and 5?"
Why the rule holds
A terminating decimal is, by definition, a number whose fractional part ends after finitely many digits. Every such decimal can be rewritten as a fraction whose denominator is a power of 10. For example, 0.175 is a three-digit decimal, so it is \tfrac{175}{1000}. The denominator 1000 = 10^3.
Now 10 = 2 \times 5, so 10^k = 2^k \times 5^k. The prime factorisation of any power of 10 contains only 2s and 5s. So if a fraction has a terminating decimal, it can be written over a denominator of the form 2^k \times 5^k — which means (after reducing to lowest terms) the denominator divides a power of 10, and that means the denominator's prime factorisation can only use 2 and 5.
Conversely, suppose your fraction \tfrac{p}{q} is in lowest terms and q's factorisation uses only 2s and 5s, say q = 2^a \times 5^b. Let k = \max(a, b). Multiply top and bottom of the fraction by whatever is missing to turn q into 2^k \times 5^k = 10^k. For example, if q = 2^3 \times 5 = 40, then k = 3 and you multiply by 5^2 = 25 to turn the denominator into 10^3 = 1000. The fraction now has a denominator that is a power of 10, and any such fraction is a terminating decimal (just write it in positional notation).
So the two conditions — "decimal terminates" and "denominator uses only primes 2 and 5" — are equivalent. That is the whole proof.
Why: the punchline is that 10 = 2 \times 5, nothing else. If 10 were 2 \times 3 instead (imagine a universe where we counted in base six), the rule would read "denominators built only from 2 and 3 terminate"; denominators containing 5 or 7 would force a repeat. The terminating-or-repeating behaviour is a fingerprint of the base, not of the fraction itself.
Worked examples — apply the rule on sight
\dfrac{3}{40}. Already in lowest terms (common factor of 3 and 40 is 1). Factorise 40 = 2^3 \times 5. Only primes are 2 and 5. Terminates. (Actual value: 0.075.)
\dfrac{11}{50}. Lowest terms. 50 = 2 \times 5^2. Only 2 and 5. Terminates. (Actual: 0.22.)
\dfrac{4}{9}. Lowest terms. 9 = 3^2. Contains a 3. Repeats. (Actual: 0.\overline{4}.)
\dfrac{6}{15}. Not in lowest terms — numerator and denominator share a 3. Reduce: \tfrac{6}{15} = \tfrac{2}{5}. The reduced denominator is 5. Terminates. (Actual: 0.4.)
\dfrac{9}{24}. Not in lowest terms — they share a 3. Reduce: \tfrac{9}{24} = \tfrac{3}{8}. The reduced denominator is 8 = 2^3. Terminates. (Actual: 0.375.)
\dfrac{7}{12}. Lowest terms. 12 = 2^2 \times 3. Contains a 3. Repeats. (Actual: 0.58\overline{3}.)
\dfrac{3}{14}. Lowest terms. 14 = 2 \times 7. Contains a 7. Repeats. (Actual: 0.2\overline{142857}.)
The fourth and fifth examples are the common trap: always reduce to lowest terms first, otherwise you will misjudge. \tfrac{6}{15} looks like it has a 3 in the denominator, but after reducing, it doesn't.
Why reducing first matters
Take \tfrac{9}{24}. The unreduced denominator is 24 = 2^3 \times 3, which contains a 3, which would incorrectly suggest "repeats." But the 3 in the denominator is cancelled by the 3 in the numerator: \tfrac{9}{24} = \tfrac{3}{8}. The reduced denominator 8 = 2^3 has no 3, so the decimal terminates.
The point of reducing to lowest terms first is to kill any common factors between numerator and denominator, which might have been hiding primes that are about to get cancelled. The question "does this decimal terminate" is a question about the fraction as a number, not about the particular notation you used to write it. Different notations for the same number can have misleading-looking denominators; only the lowest-terms denominator gives an honest answer.
If you forget to reduce, the rule still gives a correct "yes terminates" answer if the unreduced denominator passes (because reducing only removes factors, not adds them). But it might give a wrong "repeats" answer, because an unreduced denominator can have extra prime factors that reducing would strip out. So always reduce first.
A related shortcut: how many decimal digits?
If the fraction terminates, you can also predict exactly how many decimal digits there will be before the division ends. Reduce to lowest terms and write q = 2^a \times 5^b. Then the decimal terminates after exactly \max(a, b) places.
- \tfrac{3}{8} = \tfrac{3}{2^3}: a = 3, b = 0. Max is 3. So 3 decimal places — and indeed \tfrac{3}{8} = 0.375 has three digits.
- \tfrac{11}{50} = \tfrac{11}{2 \times 5^2}: a = 1, b = 2. Max is 2. Two decimal places — and \tfrac{11}{50} = 0.22 has two.
- \tfrac{7}{40} = \tfrac{7}{2^3 \times 5}: a = 3, b = 1. Max is 3. Three decimal places — \tfrac{7}{40} = 0.175 has three.
Why: to write \tfrac{p}{q} as a decimal where q = 2^a \times 5^b, you multiply top and bottom by whatever makes the denominator 10^{\max(a, b)}. The resulting numerator has at most \max(a, b) digits' worth of value after the decimal point — because the denominator is exactly 10^{\max(a, b)}, and the numerator divided by that is a decimal with that many places.
Sort these into terminating and repeating — no division allowed
Given: \tfrac{5}{6}, \tfrac{7}{25}, \tfrac{9}{16}, \tfrac{3}{11}, \tfrac{12}{75}, \tfrac{4}{35}.
Step 1. Reduce each to lowest terms.
- \tfrac{5}{6}: \gcd(5, 6) = 1. Already reduced.
- \tfrac{7}{25}: \gcd(7, 25) = 1. Already reduced.
- \tfrac{9}{16}: \gcd(9, 16) = 1. Already reduced.
- \tfrac{3}{11}: \gcd(3, 11) = 1. Already reduced.
- \tfrac{12}{75}: \gcd(12, 75) = 3. Reduces to \tfrac{4}{25}.
- \tfrac{4}{35}: \gcd(4, 35) = 1. Already reduced.
Step 2. Factorise each reduced denominator.
- 6 = 2 \times 3 — contains 3.
- 25 = 5^2 — only 5s.
- 16 = 2^4 — only 2s.
- 11 = 11 — contains 11.
- 25 = 5^2 — only 5s.
- 35 = 5 \times 7 — contains 7.
Step 3. Verdict.
- \tfrac{5}{6}: repeats (has 3).
- \tfrac{7}{25}: terminates (only 5).
- \tfrac{9}{16}: terminates (only 2).
- \tfrac{3}{11}: repeats (has 11).
- \tfrac{12}{75} = \tfrac{4}{25}: terminates (only 5).
- \tfrac{4}{35}: repeats (has 7).
Step 4. Predict how many digits for the terminating ones.
- \tfrac{7}{25} = \tfrac{7}{5^2}: two decimal places. Check: 0.28 ✓.
- \tfrac{9}{16} = \tfrac{9}{2^4}: four decimal places. Check: 0.5625 ✓.
- \tfrac{4}{25} = \tfrac{4}{5^2}: two decimal places. Check: 0.16 ✓.
Total time without division: maybe thirty seconds.
What does not matter
A few things you might be tempted to check that have no bearing on terminate-vs-repeat:
-
The numerator. In lowest terms, the numerator never affects whether the decimal terminates. \tfrac{1}{8} and \tfrac{5}{8} and \tfrac{7}{8} all terminate. \tfrac{1}{3}, \tfrac{2}{3}, \tfrac{7}{3} all repeat.
-
How "big" the denominator is. \tfrac{1}{1000000000} has a denominator of a billion, yet it terminates in nine decimal places, because 10^9 = 2^9 \times 5^9. Meanwhile \tfrac{1}{3} has a tiny denominator but never terminates. Size is not the issue; prime factors are.
-
Whether the fraction is "nice-looking." \tfrac{1}{7} looks simple, but its decimal is 0.\overline{142857}. \tfrac{13}{125} looks ugly, but its decimal is the clean 0.104. Looks are deceiving; factorise.
The takeaway
- In lowest terms, a fraction terminates exactly when its denominator's prime factorisation contains only 2s and 5s.
- Any other prime — 3, 7, 11, 13, \ldots — forces a repeating decimal.
- Always reduce the fraction first; common factors can hide the true denominator.
- The rule depends on base 10 = 2 \times 5. In a different base, the rule would read with different primes.
The full-theorem version, with the exact formula for the period of the repeating block and the connection to powers of 10 modulo q, lives in Long Division Reveals the Repeating Block. But for the everyday question "will this one stop or loop?" you only need the primes in the denominator.
Related: Fractions and Decimals · Long Division Reveals the Repeating Block — Watch the Loop Appear · Test If a Number Is Rational by Looking for Its Repeating Block · Non-Terminating vs Non-Repeating — Same Thing or Different?