Terminating Decimals Calculator

Instantly determine whether a fraction produces a terminating or repeating decimal — with full prime-factorization explanation.

Enter a numerator and denominator. The calculator simplifies the fraction, checks the prime factors of the denominator, and tells you whether the decimal terminates.

Terminating Decimals Calculator
Instantly determine whether a fraction produces a terminating or repeating decimal — with full prime-factorization explanation.

About the terminating decimals calculator

A terminating decimal is a decimal number that has a finite, definite number of digits after the decimal point. Examples include 0.5, 0.75, 0.125, and 3.25. By contrast, a repeating decimal such as 0.333… or 0.142857142857… continues infinitely. Both types are rational numbers — they can each be expressed as a fraction — but only terminating decimals fit exactly in a finite decimal representation. The rule that determines which fractions terminate is elegantly simple and follows directly from the base-10 structure of our number system. Any decimal number can be thought of as a fraction with a power of ten (10, 100, 1000, …) in the denominator. A fraction p/q terminates if and only if, when reduced to its lowest terms, the denominator q has no prime factors other than 2 and 5. This is because the only prime factors of any power of 10 are 2 and 5, and a fraction can be converted to an equivalent fraction over a power of 10 if and only if its denominator contains only these two primes. The algorithm this calculator follows has three steps. First, it computes the greatest common divisor (GCD) of the numerator and denominator and divides both by it to obtain the fraction in lowest terms. Second, it finds the prime factorisation of the simplified denominator. Third, it checks whether every prime factor is either 2 or 5. If so, the fraction terminates; if any other prime (3, 7, 11, 13, …) appears, it repeats. To illustrate: the fraction 7/20 has a denominator of 20 = 2² × 5. Since the only prime factors are 2 and 5, 7/20 is a terminating decimal. Its decimal value is 0.35, because 7/20 = 35/100. On the other hand, 1/6 has a denominator of 6 = 2 × 3. The presence of the factor 3 means 1/6 cannot be expressed over a power of 10, so it repeats: 0.1666… An important subtlety is the role of simplification. The fraction 6/30, for instance, looks complex, but simplifying by the GCD of 6 gives 1/5, whose denominator is just 5 — a terminating decimal. Similarly, 2/12 simplifies to 1/6, which repeats. This is why the calculator always reduces the fraction first before inspecting the denominator's prime factors. The size of the denominator is irrelevant to whether the decimal terminates. The fraction 1/1024 terminates because 1024 = 2¹⁰, even though 1024 is quite large. Meanwhile, 1/3 repeats because 3 is a prime other than 2 or 5, even though 3 is tiny. What matters is the nature of the prime factors, not their magnitude.

Terminating decimal examples

Four worked examples illustrating terminating and repeating fractions.

FractionDecimalWhy
3/80.375Denominator 8 = 2³. Only factor is 2 → terminates.
1/30.333…Denominator 3 is a prime other than 2 or 5 → repeating.
7/200.35Denominator 20 = 2² × 5. Factors are only 2 and 5 → terminates.
6/30 → simplifies to 1/50.2After reducing by GCD = 6, simplified denominator is 5 → terminates.

How to use the terminating decimals calculator

  1. Enter any integer in the Numerator field (positive, negative, or zero).
  2. Enter any non-zero integer in the Denominator field.
  3. Click Analyze Fraction. The calculator reduces the fraction to lowest terms, lists the prime factors of the simplified denominator, and shows whether the decimal terminates or repeats.
  4. The decimal value is computed and displayed. For terminating decimals the exact value is shown; for repeating decimals the value is shown to 10 decimal places with an ellipsis.
  5. Click Reset to clear both fields and run a new analysis.

Terminating decimals FAQ

Why do only prime factors of 2 and 5 lead to terminating decimals?
Our number system uses base 10. The number 10 = 2 × 5, so powers of 10 have only 2 and 5 as prime factors. A fraction terminates when it can be rewritten as something divided by a power of 10. That is only possible when the simplified denominator's prime factors are exclusively 2s and 5s — for example, 3/8 = 375/1000.
Does a large denominator always mean the decimal repeats?
No. Size has nothing to do with it. The fraction 1/1024 terminates because 1024 = 2¹⁰, even though the denominator is very large. Meanwhile, 1/3 repeats even though 3 is tiny. The only thing that matters is whether the simplified denominator's prime factors are exclusively 2 and 5.
Does the numerator affect whether the decimal terminates?
The numerator never affects whether a decimal terminates or repeats. Only the denominator (after simplification) matters. However, the numerator does affect the specific decimal value and how many digits it has. For example, 1/8 = 0.125 and 7/8 = 0.875; both terminate because the denominator is 8 = 2³.
What is a repeating decimal's period and how long can it be?
The period of a repeating decimal is the number of digits in the repeating block. For a fraction in lowest terms with denominator q (after removing all factors of 2 and 5), the period equals the multiplicative order of 10 modulo q. For example, 1/7 = 0.142857142857… has a period of 6. The period can be as long as q − 1.
Are all terminating decimals rational numbers?
Yes. Every terminating decimal can be written as a fraction whose denominator is a power of 10. For example, 0.375 = 375/1000 = 3/8. Since it can be expressed as a ratio of integers, it is rational. Irrational numbers such as π and √2 have non-terminating, non-repeating decimal expansions.
How does this relate to binary and computer arithmetic?
Computers store numbers in binary (base 2). A fraction terminates in binary if and only if its simplified denominator is a power of 2. This is why 0.1 (one tenth) cannot be represented exactly in binary — its denominator 10 = 2 × 5 includes a factor of 5, which is foreign to base 2. This causes the familiar floating-point rounding issues in software.