Decimal to Fraction Calculator

Convert a decimal into a simplified fraction, with a maximum denominator you choose for exact values or close approximations.

Calculations happen locally. We do not send your values to our server.

Example

0.75 becomes 3/4 and −2.5 becomes −5/2, both in lowest terms. With a limit of 1,000, 0.3333333333 returns 1/3, while 3.14159 gives 22/7 at a limit of 100 and 355/113 at a limit of 1,000.

Calculation method

A continued-fraction algorithm builds the closest fraction whose denominator stays within the limit you set, then reduces the result and places the sign on the numerator. The default maximum denominator is 1,000,000, which is exact for everyday decimals: 0.125 is returned as 1/8 rather than 125/1000.

Important notes

The tool matches the digits you actually type. With a large limit, 0.333 becomes 333/1000, because that is exactly what was entered; if you meant one third, type more digits or lower the limit. Choose a limit that suits the job, such as 16 for inch measurements or 100 for percentages.

Exact conversion for terminating decimals

Enter a decimal and keep the default maximum denominator of 1,000,000 for everyday values. 0.75 becomes 3/4 and −2.5 becomes −5/2, with the sign placed on the numerator. The calculator returns the fraction in lowest terms, so 0.125 appears as 1/8 rather than 125/1000. This is useful when a drawing, recipe or measuring tape uses fractions but your calculation produced a decimal.

Rounded decimals and repeating values

The tool treats the digits you type as the value to match. With a large limit, 0.333 becomes 333/1000, because that is exactly what was entered. If you meant one third, either type more digits or lower the maximum denominator: 0.3333333333 with a limit of 1,000 returns 1/3. The limit is the largest denominator the tool may use, so choose one that suits the job, such as 16 for inch measurements or 100 for percentages.

Best approximations of irrational numbers

For numbers that no fraction represents exactly, the calculator uses continued fractions to find the closest fraction whose denominator stays within the limit. π entered as 3.14159 becomes 22/7 with a limit of 100 and 355/113 with a limit of 1,000; 355/113 agrees with π to six decimal places. The golden ratio entered as 1.6180339887 with a limit of 100 gives 144/89. Check the decimal shown under the result to see how close the approximation is before relying on it.

Worked examples
InputResult
0.75 · max 1,000,0003/4
-2.5 · max 1,000,000-5/2
0.333 · max 1,000,000333/1000
0.3333333333 · max 1,0001/3
3.14159 · max 10022/7
3.14159 · max 1,000355/113
1.6180339887 · max 100144/89

Frequently asked questions

Why does changing the maximum denominator change the fraction?

Because the limit decides how close the approximation may get. π entered as 3.14159 becomes 22/7 with a limit of 100 and 355/113 with a limit of 1,000, and 355/113 agrees with π to six decimal places. A smaller limit gives a simpler but rougher fraction.

Is the result always exact?

Terminating decimals such as 0.75 are exact, giving 3/4. Values that no fraction can represent exactly are approximated within your limit: the golden ratio entered as 1.6180339887 with a limit of 100 returns 144/89. Check the decimal shown beneath the result to see how close it is.

Can it convert negative decimals?

Yes. The sign is applied to the numerator, so −2.5 becomes −5/2 rather than 5/−2. Decimals of any size are accepted as long as the maximum denominator is a positive whole number, and very large limits simply allow a closer match.

Related tools