A fraction $p/q$ ($q > 0$) is either a terminating or a repeating decimal — the deciding factor is the prime factors of the denominator
If you keep doing long division, a remainder shows up at every step. The remainder is an integer from $0$ to $q-1$ — there are only finitely many, so eventually one repeats or it hits $0$. If the remainder is 0 the decimal stops (terminating); if some remainder shows up again, everything after that repeats (repeating).
Why does a denominator built only from 2 and 5 give a terminating decimal? You can turn the denominator into a power of 10, like $\dfrac{1}{4} = \dfrac{25}{100}$ — once the denominator is 10, 100, or 1000, the decimal places are fixed and it stops. On the other hand, if the denominator has prime factors like 3, 7, or 11, there's no raw material to build a power of 10 — the remainder is forced to come back around.
Let's build the result step by step, instead of memorizing.
$\frac{1}{4}$: $1 \div 4 = 0$ r 1 → $10 \div 4 = 2$ r 2 → $20 \div 4 = 5$ r 0 — done, $0.25$. $\frac{1}{3}$: $10 \div 3 = 3$ r 1 — remainder 1 comes back → $0.333\ldots$ repeats.
$10 = 2 \times 5$. If the denominator has the form $2^{a} 5^{b}$, multiply numerator and denominator by the same number to make the denominator $10^{\max(a,b)}$ — $\frac{1}{8} = \frac{125}{1000} = 0.125$. A decimal whose places end = terminating.
If the denominator $q$ of the simplest fraction $p/q$ ($p, q$ relatively prime) is only a product of 2s and 5s it is terminating; if it has a prime factor other than 2 and 5 it is repeating. (Follows from the remainder-cycle logic + the fact that 10's only prime factors are 2 and 5.)
Each step also shows the "why".
The classic ways to lose points on a test.
Three questions to check the core idea. Click an option to see the explanation.
The formula is hiding in familiar scenes. Read it as a story and it sticks.
Just as 1km is about $0.621371\ldots$ miles, unit-conversion coefficients are usually repeating decimals. The fact that a decimal expansion never ends when the denominator has prime factors other than 2 and 5 is exactly why "precision exchange-rate tables have endless decimals." 1 mile = 1.609344km (terminating), but its reciprocal is repeating.
When a computer stores a repeating decimal, it chops it off at significant digits (0.3333… is stored as 0.33333333). That's why "error" accumulates in repeated calculations (compound interest, simulations) — the root cause is the truncation of repeating decimals. Understanding 1/3's repeating structure gives you intuition for why the limits of computer arithmetic (floating-point error) exist.