Home
Try:
Accepts terminating decimals (0.75, -2.5, .125) and repeating decimals written with parentheses — the digits inside the parentheses repeat forever: 0.(3) = 0.333…, 0.1(6) = 0.1666…, 12.58(3) = 12.58333…

What Is a Decimal-to-Fraction Conversion?

A decimal to fraction conversion rewrites a number given in base-10 decimal notation as an exact ratio of two integers. Because every terminating decimal and every repeating decimal is a rational number, each of them has an exact fractional form — no rounding required.

For example, 0.75 means "seventy-five hundredths", so it equals 75/100, which reduces to 3/4. Similarly, 0.1(6) = 0.1666… equals 1/6 exactly. The decimal and the fraction describe the very same number; the fraction is simply the exact form, while the decimal may be a truncated approximation.

Why Convert Decimals to Fractions?

  • Exactness: 1/3 is exact, but 0.3333 is only an approximation.
  • Algebra and geometry: fractions keep results exact through algebraic manipulation, whereas decimals accumulate rounding error.
  • Measurements: tape measures, drill sizes, and wrench sizes are graduated in fractions (1/8, 3/16, 5/32…), so a decimal measurement usually needs converting.
  • Comparison: ratios are easier to reason about as small fractions than as long decimals.
  • Standard form: math answers are conventionally reported in lowest terms rather than as decimals.

How to Convert a Terminating Decimal to a Fraction

A terminating decimal has a finite number of digits after the point. The conversion is a direct application of place value.

  1. Count the decimal places. Let n be the number of digits to the right of the decimal point.
  2. Drop the decimal point to get the numerator.
  3. Set the denominator to 10n — 10, 100, 1000, and so on.
  4. Reduce the fraction by dividing both parts by their greatest common divisor (GCD).

Example: Convert 0.75 to a fraction.

  • 0.75 has 2 decimal places → denominator 102 = 100.
  • Numerator = 75 → 0.75 = 75/100.
  • GCD(75, 100) = 25.
  • 75 ÷ 25 = 3 and 100 ÷ 25 = 4.
  • Result: 3/4.

How to Convert a Repeating Decimal to a Fraction

A repeating (recurring) decimal has a block of digits that repeats forever, such as 0.333… or 0.1666… Because the expansion is infinite, you cannot simply put the digits over a power of ten. Instead, use an algebraic trick that cancels the infinite tail.

  1. Let x equal the repeating decimal.
  2. Multiply by 10n, where n is the number of non-repeating digits, so the decimal point sits just before the repeating block.
  3. Multiply by 10n+m, where m is the length of the repeating block, so the decimal point sits just after one full repeat.
  4. Subtract the two equations. The infinite tails are identical, so they cancel, leaving a plain integer equation.
  5. Solve for x and reduce the resulting fraction.

Example: Convert 0.1(6) = 0.1666… to a fraction.

  • Let x = 0.1666… (1 non-repeating digit, 1 repeating digit)
  • 10x = 1.666…   (multiply by 101)
  • 100x = 16.666…  (multiply by 102)
  • Subtract: 100x − 10x = 16.666… − 1.666… → 90x = 15
  • x = 15/90; GCD(15, 90) = 15 → 1/6

General formula for repeating decimals

Write the decimal as I.F(R), where I is the whole part, F is the non-repeating block of n digits, and R is the repeating block of m digits. Then:

x = ( int(I F R) − int(I F) ) ÷ ( 10n+m − 10n )

This is exactly what the calculator computes. For 0.1(6): I = 0, F = 1, R = 6, n = 1, m = 1, so x = (16 − 1) ÷ (100 − 10) = 15/90 = 1/6.

Notation Used by This Calculator

Repeating decimals are entered with parentheses around the repeating block:

InputMeansExact Fraction
0.(3)0.333333…1/3
0.(6)0.666666…2/3
0.1(6)0.166666…1/6
0.8(3)0.833333…5/6
0.(142857)0.142857142857…1/7
0.(9)0.999999…1

Terminating vs. Repeating: Which Decimals Are Rational?

A decimal represents a rational number if and only if it either terminates or eventually repeats. Which one happens depends on the denominator of the fraction in lowest terms:

  • If the denominator's only prime factors are 2 and 5, the decimal terminates (e.g. 3/8 = 0.375, 7/20 = 0.35).
  • If the denominator has any other prime factor, the decimal repeats (e.g. 1/3, 1/6, 1/7, 5/12).
  • If the decimal neither terminates nor repeats — like the true value of π or √2 — the number is irrational and has no exact fractional form.

Simplifying to Lowest Terms

After the fraction is built, it is reduced by dividing the numerator and denominator by their greatest common divisor. The GCD is computed with the Euclidean algorithm: repeatedly replace the pair (a, b) with (b, a mod b) until the remainder is zero; the last non-zero divisor is the GCD.

For 75/100: 100 = 75 × 1 + 25, then 75 = 25 × 3 + 0, so GCD(75, 100) = 25, giving 3/4. A fraction is in lowest terms when its GCD is 1.

Improper Fractions and Mixed Numbers

If the decimal's magnitude is at least 1, the resulting fraction is improper and can be written as a mixed number. For 2.75: 2.75 = 275/100 = 11/4, and 11 ÷ 4 = 2 remainder 3, so the mixed number is 2 3/4.

  • Quotient → whole-number part
  • Remainder → numerator of the fractional part
  • Denominator → unchanged

Negative Decimals

Negative decimals convert exactly the same way — the sign simply stays on the numerator. For −0.6: 0.6 = 6/10 = 3/5, so −0.6 = −3/5. By convention the denominator is kept positive.

Long Decimals and Rational Approximation

A decimal typed with many digits, such as 3.14159265, is a terminating decimal and converts exactly to 314159265/100000000 — technically correct, but rarely useful. The Max Denominator option finds the closest fraction whose denominator does not exceed the limit, using the continued-fraction expansion of the number. With a limit of 10,000, 3.14159265 becomes 355/113, the famous approximation of π that is accurate to six decimal places.

Set the max denominator to 0 (the default) for an exact, unreduced-limit conversion.

How the Calculator Works

  • Parse the string into sign, whole part, non-repeating part, and repeating part.
  • Build the fraction using place value (terminating) or the shifted-equation formula (repeating).
  • Reduce by the GCD computed with the Euclidean algorithm, recording each division step.
  • Apply the max-denominator limit if one is set, using convergents from the continued-fraction expansion.
  • Convert to a mixed number when the result is improper.
  • Report the decimal value and percentage at the chosen precision, computed with exact integer arithmetic (no floating-point drift).

Supported Input Format

InputType
0.75Terminating decimal
-2.5Negative terminating decimal
.125No leading zero (accepted)
3Whole number → 3/1
0.(3)Pure repeating decimal
0.1(6)Mixed repeating decimal
12.58(3)Repeating with a whole part

Assumptions and Limitations

  • The repeating block must be enclosed in parentheses and must follow a decimal point.
  • No more than 40 characters may be entered.
  • Scientific notation (e.g. 1.2e-3) is not accepted — enter the expanded decimal instead.
  • Thousands separators and spaces are stripped automatically; commas are not treated as decimal points.
  • An irrational decimal typed with finitely many digits (π, √2, e) is treated as the exact terminating decimal you typed, not as the irrational number.
  • Results are exact for any input length; the max-denominator mode is the only source of intentional approximation, and it is flagged in the output.

❓ Decimal to Fraction FAQ

How do you convert a decimal to a fraction?

Count the digits after the decimal point (call it n), drop the decimal point to get the numerator, and put it over 10n. Then reduce by the GCD. For 0.75: two decimal places → 75/100; GCD(75, 100) = 25 → 3/4.

How do you convert a repeating decimal to a fraction?

Let x be the decimal. Multiply by 10n (n = non-repeating digits) and by 10n+m (m = repeating digits), then subtract the two equations so the infinite tails cancel. For 0.1(6): 100x − 10x = 16.666… − 1.666… = 15, so 90x = 15 and x = 15/90 = 1/6.

Why does 0.3333333 give 3333333/10000000 instead of 1/3?

Because 0.3333333 is a terminating decimal with exactly seven 3s — it is slightly less than 1/3. Only the infinitely repeating 0.(3) equals 1/3 exactly. Enter 0.(3) with parentheses to get the exact answer.

Is 0.999… equal to 1?

Yes, exactly. Using the repeating-decimal method: x = 0.999…, so 10x = 9.999…, and 10x − x = 9.999… − 0.999… = 9, giving 9x = 9 and x = 1. Every terminating decimal has an alternative repeating representation ending in 9s.

Can every decimal be written as a fraction?

Every terminating decimal and every repeating decimal can — those are precisely the rational numbers. Decimals that neither terminate nor repeat, such as the true value of π, are irrational and have no exact fractional form.

What does "lowest terms" mean?

A fraction is in lowest terms when the greatest common divisor of its numerator and denominator is 1. For example, 3/4 is in lowest terms; 75/100 is not, since GCD(75, 100) = 25.

How do I know if a decimal terminates or repeats?

Look at the fraction in lowest terms. If the denominator factors entirely into 2s and 5s, the decimal terminates (3/8 = 0.375). If any other prime appears — 3, 7, 11, 13… — the decimal repeats (1/3, 1/7, 5/12).

What is the maximum length of a repeating block?

For a fraction 1/q in lowest terms, the repeating block is at most q − 1 digits long. For 1/7 it is 6 digits (142857); for 1/17 it is 16 digits.

How do I enter a repeating decimal?

Put the repeating block in parentheses after the decimal point. 0.(3) = 0.333…, 0.1(6) = 0.1666…, 0.(142857) = 0.142857142857…, and 12.58(3) = 12.58333…

What does the Max Denominator option do?

It finds the closest fraction whose denominator does not exceed your limit, using the continued-fraction expansion. This is useful for long decimals: with a limit of 10,000, 3.14159265 becomes 355/113, a well-known approximation of π. Leave it at 0 for an exact conversion.

Can the result be a mixed number?

Yes. If the decimal's magnitude is 1 or greater, the fraction is improper and is also shown as a mixed number. For example, 2.75 = 11/4 = 2 3/4.

How are negative decimals handled?

The sign is extracted first, the absolute value is converted, and the sign is reattached to the numerator. So −0.6 becomes −3/5, keeping the denominator positive as is conventional.

Does the calculator round the decimal result?

Only for display. The fraction itself is exact, computed with integer arithmetic. The decimal value shown in the output is rounded to the precision you select in the advanced options — the fraction is the authoritative answer.

Why is a fraction better than a decimal for exact work?

Decimals can only represent fractions whose denominators divide a power of ten. Anything else — 1/3, 1/7, 5/12 — is rounded when written as a decimal, and those errors compound through repeated arithmetic. Exact fractions avoid the problem entirely.