Account

What new tool do you want?

Math & Education

Decimal ↔ Fraction Converter

Convert decimals to simplified fractions (including repeating decimals like 0.333…) and fractions to decimals with the repeating part marked.

How to use

  1. 1Choose the direction.
  2. 2Enter a decimal like 0.375, or a fraction like 5/8. For repeating decimals, enter enough digits (0.3333) or use parentheses: 0.(3).

How it's calculated

Decimal → fraction: the best rational approximation by continued fractions, simplified. Fraction → decimal: long division, detecting the repeating cycle.

Frequently asked questions

How do I write a repeating decimal?

Put the repeating part in parentheses: 0.(3) for 0.333…, or 0.1(6) for 0.1666….

Why does 0.1 + 0.2 look odd in some calculators?

Binary floating point can't represent 0.1 exactly. This converter finds the exact fraction 3/10.

What about mixed numbers?

Improper fractions are also shown as mixed numbers, e.g. 7/4 = 1 3/4.

Mixed numbers only appear when the fraction is actually improper

The mixed-number output is identical to the plain fraction whenever the numerator's absolute value is smaller than the denominator — there's no whole-number part to pull out of, say, 3/8, so both fields show the same 3/8. It's only once the numerator exceeds the denominator, as with 7/4, that a whole number splits out (1 3/4), which is why checking the mixed-number field is a quick way to tell at a glance whether a converted decimal was greater than 1 without having to compare the fraction's numerator and denominator yourself.

Worked example: why 1/7 never terminates

Dividing 1 by 7 by hand gives 0.142857142857…, repeating forever — the converter shows this as 0.(142857), with the repeating block in parentheses. That happens because 7 shares no factors with 10 (only 2 and 5 make a decimal terminate), so the remainder in long division can never hit exactly zero; it just cycles through a fixed set of leftover remainders and repeats once it returns to one it's already seen. By contrast, 5/8 = 0.625 exactly, because 8 = 2³ divides evenly into a power of 10 (1000).

Why 0.1 + 0.2 looks wrong in most calculators but not here

Computers store decimals in binary, and 0.1 has no exact binary representation — the same way 1/3 has no exact decimal representation. That's why 0.1 + 0.2 shows as 0.30000000000000004 in a typical programming language. This converter sidesteps that entirely by working with exact integer numerators and denominators: 0.1 becomes the exact fraction 1/10, with no rounding error possible, because it's built directly from the digits you typed rather than from floating-point math.

Writing repeating decimals so the tool reads them correctly

0.375 converts straightforwardly to 3/8. For a repeating decimal, the parentheses tell the converter exactly which digits repeat: 0.(3) means 0.333… and resolves to 1/3; 0.1(6) means 0.1666… (only the 6 repeats, not the 1) and resolves to 1/6. Leaving out the parentheses and just typing more digits (0.3333) still works but produces a close rational approximation rather than the mathematically exact fraction — fine for most purposes, but not identical to 1/3.

Very long decimals switch to an approximation method, with a real limit

Up to 9 digits after the decimal point, the converter builds the exact fraction directly from the digits you typed — no approximation involved. Past that, it switches to a continued-fraction method capped at a denominator of one million, which finds the closest simple fraction rather than reconstructing your exact digits. Typing 3.1415926536 (10 digits) illustrates the gap: the mathematically exact fraction is 3926990817/1250000000, but the continued-fraction approach returns the much simpler 1771786/563977 instead — a fraction that equals 3.141592653601122, matching your input to 11 decimal places but not beyond. For everyday use that's an imperceptible difference; for a case that needs the input preserved to the exact digit, keep the typed decimal under 10 digits after the point.

Related tools

More: Math & Education