Decimal to Fraction Calculator

Convert a real number into a fraction.





How to use the decimal to fraction calculator.

This calculator allows you to convert real numbers, including repeating decimals, into fractions.

Enter a decimal number in the space above, then press Convert to Fraction to send the number and calculate the equivalent fraction.

Number formats

You may enter simple rational numbers with the whole portion separated from the decimal portion by a decimal point (ex. 12.25). You may also convert to fractions numbers with infinitely repeating digits by enclosing the repeating digits in parenthesis or by adding '...' at the end of the number. See the following table for examples:

Type of numberExampleWhat to enterResult
Simple decimal12.12512.12597/8
Repeating decimal0.30.3... or 0.(3)1/3
Repeating decimal0.1230.1233... or 0.12(3)37/300
Repeating sequence0.7450.74545... or 0.7(45)41/55

How to convert a decimal number to it's equivalent fraction

When the number has no repeating decimal portion, the numerator of the equivalent fraction is obtained by removing the dot from the number, and the denominator is '1' followed by the same number of 0's as the length of the decimal portion.

For example the number 12.4 is equal to 123 divided by 10, so the equivalent fraction is 124/10, which, when simplified, becomes 62/5.

This is because the number is multiplied by a power of 10 such that the decimal point is removed. The resulting number is then shown divided by the same power of 10 to represent the original number as a fraction.

When the number has infinitely repeating decimals, then the fraction is obtained by breaking the number into a sum of the non-repeating portion and the repeating portion. Each element is converted separately, the non repeating portion is converted as explained above, while the fraction for the repeating portion is obtained by dividing the repeating figures by a number of 9's equal to the length of the sequence, followed by a number of '0's equal to the the number of 0's between the dot and the repeating digits.

For example the number 2.5333... is broken into the sum 2.5+0.0333, 2.5 becomes 5/2 and 0.0333 becomes 33/990 or,simplified, 1/30. The result of the conversion is therefore (5/2)+(1/30)=38/15

All fractions are reduced as soon as possible to simplify the subsequent operations.

When the number cannot be converted

Very big numbers or numbers with many digits after the floating point may not be converted here. When the equivalent fraction cannot be calculated, the error "Sorry, overflow error" will be displayed.