Convert decimal number to fraction

This tool makes it easy to convert a decimal number to a fraction, either exactly or as an approximation with a denominator of limited size.

A fraction is an expression that describes a division operation between two values. The value on top of the fraction line is called the numerator and the one below is called the denominator. When a number is written in its fractional form it means that the number is written as a fraction with both numerator and denominator being whole numbers.

To use this tool you first have to enter the decimal number that you want to convert to a fraction. When the convert button is pressed the tool will step through all the integer denominators in increasing order, starting from 1. For each denominator the numerator that gives a quotient closest to the decimal number is calculated.

The tool shows the best fraction that has been found, and will update as soon as it finds one that is better. The amount in which the fraction differs from the target value is refered to as the error. The process stops as soon as an exact match is found (i.e. when the error is zero).

It is possible to limit how large denominator that you want to allow. This can for instance be useful when the decimal number has been rounded. For example, the number 0.6666… (where the sixes continues forever) could be rounded to 0.667, but if you enter this value the tool will find the fraction 667 / 1000. By limiting the denominator to not be greater than 100 the correct fraction 2 / 3 is found.

Limiting the denominator can also be used to find approximations of irrational numbers, i.e. numbers that cannot be represented exactly using a fraction. A classic example of such a number is π. It is of course possible to get a more exact fraction if the denominator is allowed to be of any size but often it is more practical to use smaller numbers. Note that it is possible to use mathematical expressions so all that you need to do in order to find an approximation for π is to write the word "pi" in the input field for the decimal number. A common approximation of pi is 22 / 7.

Other tools that use fractions

Simplify a fraction as much as possible.
Perform calculations with two fractions and see how the calculations are done in detail.
Calculate the lowest common denominator for two or more fractions.