Maths & numbers

Decimal to fraction converter

Convert decimals, repeating decimals and fractions, or find the closest fraction with a small denominator.

Decimal to fraction converter
Esc to restore

Your inputs

Decimals like 0.375, repeating decimals like 0.1(6) or 0.(142857), fractions like 22/7 and mixed numbers like 3 1/7.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

Terminating decimals become digits ÷ 10^k; a repeating decimal A.B(C) equals (ABC − AB) ÷ (10^k(10^m − 1)) for k fixed and m repeating digits. Fractions are reduced by the greatest common divisor with exact arbitrary-size integers. Long division finds the repeating block of any fraction. The closest-fraction mode uses continued fractions and semiconvergents to find the best fraction under a denominator limit. Scientific notation is not accepted.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Value
0.1(6)
Convert
Decimal → fraction (brackets mark repeating digits)
Largest denominator (closest-fraction mode)
1000

Example result

Simplified fraction
1/6
Mixed number
1/6
Decimal
0.1(6)
Percentage
16.6666666667%
Terminating or repeating?
Repeating, period 1

Fractions are exact (arbitrary-size integers) and reduced by the greatest common divisor. A fraction terminates only if its reduced denominator has no prime factors other than 2 and 5; digits in brackets repeat forever. Repeating blocks longer than 10,000 digits are cut off.