Math

Decimal to Fraction Calculator

Enter a decimal number and, optionally, the largest denominator you want.

Your numbers

Use a small limit such as 10 or 100 for a simple approximation

Your results

Fraction
Fraction
—
Mixed number
—
Difference from the decimal
—

Decimal to Fraction Calculator by TheCalcTools

How the Decimal to Fraction Calculator works

A terminating decimal is a fraction over a power of 10 (0.875 = 875/1000), which simplifies to lowest terms (7/8). The calculator uses continued fractions, which also find the closest fraction when the denominator is limited.

Continued fractions give the best rational approximations: for π, 22/7 with a denominator under 100 and 355/113 under 1000.

The formula

x = a₀ + 1/(a₁ + 1/(a₂ + …)); the convergents pₖ/qₖ are the best approximations

Worked example

Using the default values shown in the calculator:

Decimal number0.875
Largest denominator allowed1e+06
  1. 0.875 = 7/8.

Result:

Fraction7/8
Mixed number—
Difference from the decimal0.0000

Frequently asked questions

What is 0.875 as a fraction?

7/8.

Why limit the denominator?

To get a simple fraction that is close enough. For 0.3183, a limit of 10 gives 1/3 and a limit of 1000 gives 247/776.

Sources and further reading

More in Math · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.