Audited ·Last updated 27 Jul 2026·5 citations·Tier 2·0 uses

Fraction to Decimal Calculator

Convert any fraction to a decimal and see instantly whether it terminates or repeats, with the exact repetend length — computed from prime factors.

Fraction to Decimal Calculator

The top number of the fraction.
The bottom number of the fraction. Cannot be zero.
Decimal value
0.375
Numerator divided by denominator, rounded to 10 decimal places.
Terminates?
1
Repetend length
0
Digits before the repeat
3
Simplified numerator
3
Simplified denominator
8

Background.

A fraction to decimal calculator divides a numerator by a denominator and, just as importantly, tells you honestly whether the result terminates after a finite number of digits or repeats forever. That second part is where most calculators cut corners. It is easy to compute 1 divided by 7 and print however many digits fit on screen — 0.1428571429 — but that display is a rounded approximation of an infinitely repeating decimal, and a calculator that does not say so is quietly hiding information a student, engineer, or teacher may need. This calculator states the fact directly: 1/7 repeats, its repeating block (called the repetend) is 142857, and that block is exactly six digits long — not because six digits happened to fit on a screen, but because six is a property of the number 7 itself.

The distinction between terminating and repeating decimals is not a matter of how many digits you choose to display; it is a theorem. A fraction reduced to lowest terms has a terminating decimal expansion if and only if its denominator's only prime factors are 2 and 5 — the two prime factors of 10, the base of our number system. The fraction 3/8 terminates at 0.375 because 8 is 2 cubed and nothing else. The fraction 1/6 repeats forever as 0.1666… because 6 factors as 2 times 3, and that stray factor of 3 is exactly why no finite number of decimal digits can ever represent it exactly. This calculator performs that prime-factorization test directly on your reduced denominator rather than guessing from the shape of the decimal, which is the only way to get the answer right for every possible fraction, including ones whose repeating pattern would not become visible for dozens of digits.

When a fraction does repeat, the natural next question is how long the repeating block is, and that also has an exact, computable answer rather than a rule of thumb: the repetend length equals the smallest power to which you can raise 10 and get a result that is congruent to 1, modulo the denominator's part that is coprime to 10. This quantity is called the multiplicative order of 10, and number theorists have studied it since well before electronic calculators existed, because it also determines cycle lengths in areas as varied as cryptography and coding theory. For 1/7 the order is 6; for 1/13 it is also 6 (with the leading-zero repetend 076923); for 1/17 it climbs to 16. This calculator computes the order directly by iterating the remainder of successive powers of 10, which is fast and exact for any denominator up to 100,000 — far beyond what anyone would ever type by hand.

People need this calculator for reasons that go beyond curiosity. A student checking long-division homework wants to confirm not just the digits but whether their teacher's answer key is showing a rounded or an exact value. An engineer converting a fractional tolerance into a decimal for a CAD system wants to know if the value will terminate cleanly or needs to be flagged as an approximation. A programmer debugging floating-point precision issues wants to understand which fractions their number system can represent exactly and which it cannot — since binary floating point, notably, can only terminate for denominators that are pure powers of 2, which is a stricter condition than the base-10 rule this calculator applies, and is exactly why 0.1 (one tenth) cannot be stored exactly in ordinary double-precision floating point even though it terminates cleanly in decimal. Understanding the terminating/repeating distinction for base 10 is the first step toward understanding why that surprising fact about computers is true.

This calculator's sibling tool, decimal-to-fraction, runs the same mathematics in reverse: given a decimal (including a marked repeating block), it recovers the exact original fraction. Used together, the two tools form a complete, exact round trip between fractions and decimals — something no amount of manual long division or approximate calculator arithmetic can guarantee.

What is fraction to decimal calculator?

Converting a fraction to a decimal means performing the division indicated by the fraction bar — numerator divided by denominator — and expressing the result in base-10 positional notation. Every fraction of two integers is a rational number, and every rational number's decimal expansion falls into exactly one of two categories: terminating (a finite string of digits after the decimal point, such as 0.375) or repeating (an infinite block of digits, called the repetend, that repeats forever without ever settling, such as the 6 in 0.1666…). Which category a fraction falls into is determined entirely by the prime factorisation of its denominator once the fraction has been reduced to lowest terms: if the only prime factors present are 2 and 5, the fraction terminates; if any other prime factor survives, the fraction repeats. When a fraction repeats, two further numbers describe its decimal expansion completely: the preperiod length, which counts how many digits appear before the repeating block starts, and the repetend length, which counts how many digits are in the repeating block itself. The preperiod is determined by the largest power of 2 or 5 dividing the denominator; the repetend length is determined by the multiplicative order of 10 modulo whatever remains of the denominator once every factor of 2 and 5 has been removed. This calculator computes all of these quantities exactly, using the denominator's actual prime structure rather than inferring them from how the decimal happens to display.

How to use this calculator.

  1. Enter the numerator (the top number of the fraction).
  2. Enter the denominator (the bottom number of the fraction). It cannot be zero.
  3. Read the decimal value, rounded to 10 decimal places.
  4. Check whether the expansion terminates or repeats using the "Terminates?" output (1 = terminates, 0 = repeats forever).
  5. If it repeats, read the repetend length (how many digits repeat) and the digits-before-repeat count to understand the full structure of the expansion.

The formula.

terminates ⟺ d = 2ˣ·5ʸ; else period = ord₁₀(d′)

First, the fraction is reduced to lowest terms using the Euclidean algorithm, dividing both the numerator and denominator by their greatest common divisor. This step matters because the terminating/repeating test only applies to the reduced denominator — an unreduced fraction like 14/35 looks like it might repeat, but once reduced to 2/5 it plainly terminates, because 5 is one of the two allowed prime factors.

Next, every factor of 2 is stripped from the reduced denominator, and the count of factors removed is recorded as x. The same is done for every factor of 5, recording the count as y. What remains, called d′, contains only prime factors other than 2 and 5. If d′ equals 1 — meaning the denominator was entirely built from 2s and 5s — the decimal terminates, and the number of digits in that terminating expansion equals the larger of x and y, because that is exactly the power of 10 needed to clear every fractional denominator down to a whole number.

If d′ is greater than 1, the decimal repeats, and the length of the repeating block is the multiplicative order of 10 modulo d′: the smallest positive integer k such that 10 raised to the k leaves a remainder of exactly 1 when divided by d′. This quantity always exists once every factor of 2 and 5 has been removed, because stripping those factors guarantees 10 and d′ share no common factor, and Euler's theorem in elementary number theory guarantees that some power of 10 must eventually cycle back to a remainder of 1. The calculator finds this k directly by repeatedly multiplying the running remainder by 10 and taking it modulo d′, stopping the moment the remainder returns to 1 — a search that is always fast because the order can never exceed d′ − 1 steps.

The digits that appear before the repeating block begins — the preperiod — are governed by the same x and y computed earlier: it is the larger of the two, because that is how many decimal places are needed before the denominator's remaining factor of 2 or 5 has been fully absorbed into the decimal point's shift, after which only the coprime part d′ continues to generate new remainders forever.

A worked example.

Example

Take the famous fraction 1/7. It is already in lowest terms — 1 and 7 share no common factor — so the reduced numerator and denominator are 1 and 7 exactly as entered. Next, strip factors of 2 and 5 from the denominator, 7. Since 7 is not divisible by 2 or by 5, no factors are removed: x = 0, y = 0, and d′ = 7 itself. Because d′ is greater than 1, the decimal repeats, and the preperiod length — the larger of x and y — is 0, meaning the repeating block starts immediately after the decimal point. To find the repetend length, compute successive powers of 10 modulo 7: 10¹ ≡ 3, 10² ≡ 2, 10³ ≡ 6, 10⁴ ≡ 4, 10⁵ ≡ 5, and 10⁶ ≡ 1 (mod 7). The remainder returns to 1 after exactly 6 steps, so the repetend length is 6. Long division confirms this directly: 1 ÷ 7 = 0.142857142857…, with the six-digit block "142857" repeating forever. The decimal value, rounded to 10 places, is 0.1428571429. A student checking this by hand would confirm the six-digit cycle by continuing the long division past twelve digits and observing that the same six remainders (3, 2, 6, 4, 5, 1) recur in the same order indefinitely.

denominator7
numerator1

Frequently asked questions.

Why does 1/7 repeat but 1/8 doesn't?
It comes down entirely to the prime factors of the denominator. 8 factors as 2 × 2 × 2 — only the prime 2, one of the two special prime factors of 10 (the other being 5) — so 1/8 terminates cleanly at 0.125. 7 is itself a prime number, and it is neither 2 nor 5, so no finite shift of the decimal point can ever clear it out of the denominator; the division must repeat forever. This rule works for every fraction: check only the reduced denominator's prime factors, not the digits of the decimal itself.
What is a repetend, and how is its length determined?
The repetend is the block of digits that repeats forever in a repeating decimal — for 1/7 = 0.142857142857…, the repetend is "142857", six digits long. Its length is not arbitrary; it equals the multiplicative order of 10 modulo the denominator's part that has no factors of 2 or 5. In plain terms: keep multiplying a running remainder by 10 and taking it modulo that denominator, and count how many multiplications it takes before the remainder returns to 1. That count is always the exact repetend length, and it can never exceed one less than the denominator itself.
Can reducing a fraction change whether it terminates?
Yes, and this is a common source of confusion. The terminating/repeating test applies only to the fraction in lowest terms. The fraction 14/35 looks like it involves the prime factor 7 in its denominator (35 = 5 × 7), which would normally force a repeating decimal — but 14/35 reduces to 2/5 once you divide both terms by their greatest common divisor, 7, and 2/5 = 0.4 terminates immediately because 5 is one of the two allowed prime factors. Always reduce a fraction to lowest terms before applying the terminating/repeating test; this calculator does that reduction automatically before running the classification.
Does a negative denominator change whether a fraction terminates or repeats?
No. The sign has no bearing on the terminating/repeating classification, because the classification depends only on the magnitude of the denominator's prime factors, not on its sign. The calculator moves any negative sign onto the numerator during reduction — so 3/-4 becomes -3/4 internally — and then runs the same terminating/repeating test on the positive denominator, 4. The result: -3/4 = -0.75, a terminating decimal, exactly as 3/4 would be.
How is this different from the decimal-to-fraction calculator?
This calculator and Quanta's decimal-to-fraction calculator perform exactly opposite conversions using the same underlying number theory. This tool starts with a fraction and produces a decimal plus an honest terminating/repeating classification. The decimal-to-fraction calculator starts with a decimal — including a marked repeating block — and recovers the exact original fraction in lowest terms. Used together, they let you move losslessly in either direction between the two representations, which is useful for checking your own long-division arithmetic or verifying a fraction someone else has converted.
Why is there a limit on how large the denominator can be?
Finding the repetend length requires searching for the smallest power of 10 that leaves a remainder of 1 when divided by the denominator's coprime part, and in the worst case that search can take almost as many steps as the denominator's value. Capping the denominator at 100,000 keeps that search effectively instantaneous while comfortably covering every fraction a person would realistically type by hand — even denominators in the thousands, like those from unreduced survey or engineering data, resolve in a fraction of a second.
Is 0.1 (one tenth) an example of a terminating decimal, and why can't computers store it exactly?
Yes — 0.1 = 1/10, and 10 = 2 × 5, so by the terminating rule this calculator applies, 1/10 terminates immediately at one digit. The catch is that ordinary computer floating-point numbers are stored in base 2, not base 10, and the terminating rule for base 2 is stricter: a fraction only terminates in binary if its denominator is a pure power of 2. Since 10 includes a factor of 5, 1/10 cannot be represented exactly in binary floating point, which is why 0.1 famously displays as a long non-terminating string of digits inside most programming languages even though it terminates cleanly in ordinary decimal notation.

References& sources.

  1. [1]Niven, I., Zuckerman, H.S. & Montgomery, H.L. (1991). An Introduction to the Theory of Numbers, 5th ed. New York: Wiley. Theorem 4.3 — a fraction in lowest terms terminates iff its denominator's only prime factors are 2 and 5.
  2. [2]Burton, D.M. (2010). Elementary Number Theory, 7th ed. New York: McGraw-Hill. §4.2 — the repetend length as the multiplicative order of 10 modulo the denominator's part coprime to 10.
  3. [3]Euclid (c. 300 BCE). Elements, Book VII, Proposition 2 — the Euclidean algorithm for the greatest common divisor. English translation: Heath, T.L. (1908), The Thirteen Books of Euclid's Elements, Cambridge University Press.
  4. [4]NIST Digital Library of Mathematical Functions, §27.1 — Functions of Number Theory: multiplicative order, divisors, and the greatest common divisor.
  5. [5]OpenStax (2020). Prealgebra 2e. Rice University — peer-reviewed open-access textbook; §5.3 "Decimals and Fractions" covers converting fractions to decimals via long division, including repeating-decimal notation.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon