Fraction conversion

Decimal to Fraction Calculator

Convert a decimal into a nearby reduced fraction, including negative values and zero.

Decimal input

Enter a decimal number

Decimal → fraction
Accepted range: −1,000,000,000 to 1,000,000,000.
Fraction result

Equivalent fraction

Your fraction will appear here

Enter a finite decimal value to find its fraction form.

What is Decimal To Fraction?

This calculator rewrites a decimal as a reduced fraction. The fraction and decimal represent the same point on the number line, but the fraction can make a ratio easier to recognize. For example, 0.75 becomes 3/4 and −1.5 becomes −3/2.

It accepts finite values from −1,000,000,000 through 1,000,000,000. A bounded continued-fraction search returns an exact or close fraction with a denominator no larger than 1,000,000.

How to Use This Calculator

  1. Enter one finite decimal from −1,000,000,000 to 1,000,000,000. A leading zero, as in 0.0625, makes small values easier to read.
  2. Select Calculate. The calculator searches for a fraction within an absolute tolerance of 0.000000000001, subject to the denominator limit.
  3. Read the answer as numerator over denominator. A negative sign is placed on the numerator.
  4. Divide the numerator by the denominator to check the decimal value.

Zero is returned as 0/1, and an integer such as 8 is returned as 8/1. The denominator is limited to 1,000,000 and the search is capped at 100 iterations. A decimal that needs a larger denominator may be approximated; compare the quotient with the input when precision matters.

Formula Used

The calculator uses continued fractions. At each step it takes the whole-number part, then repeats with the reciprocal of the remaining fractional part. The successive convergents produce reduced numerator/denominator pairs. The search stops when the absolute difference is at most 0.000000000001, the denominator would exceed 1,000,000, or 100 iterations have run.

For example, 0.375 is represented exactly as 3/8. A long decimal such as 0.3333333333333333 can be represented closely by 1/3, while 0.333333 can be represented as 333333/1000000. The output depends on the entered value and the configured denominator bound.

Variables Explained

Parts of a decimal-to-fraction conversion
TermMeaningExample
Decimal xThe entered real number to represent0.375
Numerator nThe top integer in the result3
Denominator dThe positive bottom integer; it cannot be zero8
Fraction n/dA rational approximation to x3/8 = 0.375
ToleranceThe allowed difference between x and n/dUsed to stop the search

Worked Example

Convert 1.375. Because it has three decimal places, first write 1375/1000. Both numbers are divisible by 125:

1375 ÷ 125 = 11
1000 ÷ 125 = 8

The reduced result is 11/8. Checking by division gives 11 ÷ 8 = 1.375. It can also be written as the mixed number 1 3/8, although the calculator displays the improper fraction.

For a negative example, −0.125 becomes −125/1000. Reducing by 125 gives −1/8. A rounded input such as 0.333333 is not the same decimal as 1/3, so its result is checked against the exact entered value and denominator limit.

Why Use This Calculator?

The result is a numerator and denominator in lowest practical terms from the continued-fraction search. An improper fraction, whose numerator is larger than its denominator, is valid. Divide it into a whole part if a mixed-number format is needed.

Remember that a typed decimal may already be rounded. The fraction 1/3 has a recurring decimal, while 0.33 is exactly 33/100 if those two decimal places are treated as exact. An approximation tool may choose a familiar nearby fraction depending on tolerance. For measurements, do not claim more precision than the original measurement supports.

Fractions are unitless representations until context supplies a unit. Converting 0.25 metre to 1/4 does not erase the metre; it means 1/4 metre.

To compare two possible answers, convert both back to decimals or cross-multiply them. A larger denominator is not evidence of greater accuracy by itself. The correct choice depends on whether the entered decimal is exact and what precision the original information supports.

Common Mistakes

  • Do not assume every displayed decimal is exact; it may be rounded from a recurring value.
  • Keep the negative sign with the whole fraction, not with both numerator and denominator.
  • A denominator of 1 is normal for an integer: 7/1 equals 7.
  • Do not read 0.05 as five tenths; it is five hundredths, or 1/20.
  • When converting by hand, use one zero in the denominator for each decimal place before reducing.
  • Do not use the fraction’s slash as a mixed-number separator. Eleven eighths is 11/8, while 1 3/8 is its mixed form.

Frequently Asked Questions

Why did 0 become 0/1?

A fraction needs a nonzero denominator. Zero divided by one is exactly zero, so 0/1 is the standard valid fraction form.

Can it convert a negative decimal?

Yes. The magnitude is converted and the sign is applied to the numerator. For example, −2.25 becomes −9/4.

Why can a decimal be approximated?

The search stops at a maximum denominator of 1,000,000 or once its absolute error is at most 0.000000000001. The exact six-place decimal 0.333333 is 333333/1000000; a value entered closer to 1/3 may be returned as 1/3.

Does the calculator show mixed numbers?

No. It returns an improper fraction. Divide the numerator by the denominator for the whole part, then keep the remainder over the same denominator.

Is the returned fraction always exact?

It is exact for many ordinary finite inputs. For long or rounded decimals, the denominator and tolerance limits can produce a close approximation. Divide the result to check it against the precision you need.

Sources & References