Skip to content
ΣCalcYeti

Decimal to Fraction Calculator

Convert a finite decimal to an exact fraction in lowest terms without floating-point approximation.

Content updated August 1, 2026

Simplified fraction
3 / 8
Exact base-10 conversion; no floating-point approximation
Before reducing
375 / 1000
Common divisor
125
Mixed number
3/8
Exact decimal
0.375

The input is read as text and converted with integers, so a value such as 0.1 becomes exactly 1/10. Repeating-decimal notation is not inferred.

A finite decimal is an integer divided by a power of ten. This calculator reads the entered digits directly, builds that exact fraction, then divides numerator and denominator by their greatest common divisor.

Because the decimal is parsed as text rather than first converted to a floating-point number, 0.1 becomes exactly 1/10. The result also shows the unreduced power-of-ten fraction, common divisor, and mixed-number form.

The Decimal to Fraction formula

n = decimal digits as an integer; d = 10^k; result = (n ÷ g)/(d ÷ g)

k = number of decimal places · g = gcd(|n|, d). The sign is stored on n and d stays positive.

Worked example

For 0.375, k = 3, so the initial fraction is 375/1,000. Since gcd(375, 1,000) = 125, divide both by 125 to get 3/8.

Assumptions, rounding, and limitations

Assumptions

  • The input is a standard finite base-10 decimal.
  • The value is dimensionless or the fraction retains the input's implied unit.
  • A leading sign applies to the complete value.

Rounding: No numeric rounding occurs; the entered decimal digits are converted exactly with integer arithmetic.

Limitations

  • Accepts up to 50 total digits and 30 digits after the decimal point.
  • Does not accept scientific notation, fraction syntax, locale grouping separators, or repeating-decimal notation.

From decimal places to a denominator

Count the digits after the decimal point. One place gives a denominator of 10, two places give 100, three places give 1,000, and k places give 10^k. Remove the decimal point to form the numerator, keeping the sign.

The last step is reduction. Divide both numbers by their greatest common divisor so they share no factor larger than one.

Frequently asked questions

How do I convert a decimal to a fraction?

Remove the decimal point for the numerator, use 10 raised to the number of decimal places for the denominator, then reduce by the greatest common divisor.

What is 0.125 as a fraction?

0.125 is 125/1,000. The greatest common divisor is 125, so the simplified result is 1/8.

Can I convert a negative decimal?

Yes. The negative sign is kept on the numerator, and the denominator remains positive.

Does this handle repeating decimals?

No. It converts only the finite digits entered. Repeating notation such as 0.3 with a bar is not accepted or inferred.

Related calculators

Disclaimer: Decimal to Fraction Calculator results are estimates for general information and education only, and are not financial, tax, legal or medical advice. Verify important decisions with a qualified professional.