Decimal to fraction converter

Convert finite decimals to exact fractions, or fractions back to decimal notation.

Finite decimals (including e notation), or fractions such as -1 1/2. Positive denominator; up to 150 input characters and exponent ±100. Decimal output truncates after 150 places with …; repeating-decimal input is unsupported.

YOUR ANSWER

Exact fraction

1/8

Decimal
0.125
Precision
Exact finite decimal
How it’s calculatedCalculated on your device

Write finite decimal digits over a power of ten, then reduce by the greatest common factor. Fraction to decimal uses long division.

Displayed values may be rounded. Calculations keep the underlying precision.

Up to 150 input characters; decimal exponents range from -100 to 100. Fraction denominators must be positive and nonzero. Repeating-decimal input is not supported. Decimal output truncates after 150 places with an ellipsis; the exact fraction remains available.

The formula, made simple

Keep finite decimal digits exact when converting to a simplified fraction. Reverse mode uses long division on fractions and mixed numbers.

Place decimal digits over the matching power of ten and divide numerator and denominator by their greatest common factor.

A worked example

0.125 = 125/1000 = 1/8. A mixed number such as -1 1/2 converts to -1.5.

A few useful answers

Is 0.333 the same as 1/3?

No. A finite 0.333 is exactly 333/1000. The fraction 1/3 has a repeating decimal expansion.

Back to calculator ↑