What the Decimal to Fraction Converter does
This converter turns a decimal into its simplest fraction and mixed number - 0.375 becomes 3/8, 2.75 becomes 2 3/4 - and handles repeating decimals such as 0.333... or 0.1(6) exactly. It also works the other way, turning 7/16 into 0.4375 and 43.75%, and gives the nearest inch fraction to 1/64 for measuring and machining.
The arithmetic is exact: your digits are read as text and kept as whole-number numerators and denominators, so 0.1 is exactly 1/10 rather than the slightly-off binary value most calculators store. The working is shown step by step.
How to use it
- Type the number. For a terminating decimal just type it (0.625). For a repeating decimal put the repeating digits in brackets - 0.(3) for 0.333..., 0.1(6) for 0.1666... - or end it with three dots and the tool finds the repeating block.
- Read the simplest fraction in the big panel, with the mixed number, the exact decimal and the percentage beside it.
- If you need a fraction with a small denominator - a recipe, a ruler, a gear ratio - choose the largest denominator you will accept. The tool picks the closest fraction within that limit and shows how far off it is.
- For inch measurements choose 1/8, 1/16, 1/32 or 1/64 of an inch. The nearest inch fraction is reduced (8/16 shows as 1/2) and the rounding error is given in inches and millimetres. The chart under the inputs lists every step.
Reading the results
"Simplest fraction" means lowest terms: the numerator and denominator share no common factor. 0.375 is 375/1000, and dividing both by 125 gives 3/8.
A fraction in lowest terms has a terminating decimal only if its denominator has no prime factors other than 2 and 5. That is why 3/8 ends (0.375) and 1/3 never does (0.(3)). Every repeating decimal is a fraction, and the brackets show exactly which digits repeat.
If you type a long rounded value such as 0.3333, the exact answer is 3333/10000 - which is honest but probably not what you meant. The nearest-fraction line shows 1/3, the fraction you were most likely rounding. Use the repeating notation when you know the digits go on forever.
Worked example: 0.1666... and a 2.53-inch measurement
0.1666... repeats the 6 after one non-repeating digit, so it is written 0.1(6). Let x = 0.1666...; then 100x = 16.666... and 10x = 1.666..., and subtracting gives 90x = 15. So x = 15/90 = 1/6.
A part measures 2.53125 inches. 0.53125 x 64 = 34 exactly, so it is 2 34/64 inches, which reduces to 2 17/32. A reading of 2.53 inches instead gives 0.53 x 64 = 33.92, which rounds to 34/64 - still 2 17/32, now 0.00125 inch (0.03 mm) larger than the reading.
Formulas and scoring rules
- Terminating decimal
d with n decimal places = (d x 10^n) / 10^n, then divide by gcd0.375 = 375 / 1000 = 3/8 after dividing by gcd(375, 1000) = 125.- Repeating decimal I.A(R)
fraction = I + (AR - A) / (10^n x (10^k - 1))A is the n non-repeating digits, R the k repeating digits, and AR the two written together as one number. 0.1(6): (16 - 1) / (10 x 9) = 15/90 = 1/6.- Mixed number
whole = floor(|p| / q); remainder = |p| mod q; p/q = whole remainder/q- Nearest fraction with denominator <= N
continued fraction [a0; a1, a2, ...] -> convergents p/q and the best semiconvergent with q <= NThis is the standard best-rational-approximation method (the same one as Python's Fraction.limit_denominator). For pi it gives 22/7 for N = 10 and 355/113 for N = 1000.- Inch fraction
k = round(x x D); fraction = k / D, reduced; error = k / D - xD is 8, 16, 32 or 64. 1 inch = 25.4 mm exactly.
Limitations: what the result does not prove
- Up to 60 digits are accepted. That covers any real measurement; beyond it the tool stops rather than slowing your browser.
- "0.25..." is ambiguous. When no block visibly repeats, the last digit is taken as the repeating one (0.2(5) = 23/90) and the result says so - use brackets to be certain.
- Inch fractions are rounded to the nearest step, with halves rounded away from zero. For tolerances, check the error line rather than the fraction alone.
- It converts numbers, not units: 0.5 means one half, not half an inch, unless you are reading the inch line.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- NIST SP 811 - Guide for the Use of the International System of Units (1 in = 25.4 mm exactly)
- Python documentation - fractions.Fraction.limit_denominator
Frequently asked questions
How do you convert a decimal to a fraction?
Write the digits after the point over 1 followed by as many zeros as there are decimal places, then simplify. 0.625 has three places, so it is 625/1000; both divide by 125, giving 5/8. The converter does this exactly and shows each step.
How do you turn a repeating decimal into a fraction?
Multiply by powers of ten so the repeating part lines up, then subtract to cancel it. For 0.(3), 10x - x = 3.(3) - 0.(3) = 3, so 9x = 3 and x = 1/3. Type it as 0.(3) or 0.333... and the tool does the algebra.
What is 0.625 as a fraction in lowest terms?
5/8. As a percentage it is 62.5%, and on a tape measure it is the 10/16 mark, which reduces to 5/8 of an inch.
Why does a calculator show 0.3333333 instead of 1/3?
A calculator stores a limited number of digits, so it cuts the endless 3s off. Typing 0.3333333 here gives the exact but awkward 3333333/10000000; the nearest-fraction line shows the 1/3 you probably meant, and typing 0.(3) gives exactly 1/3.
How do I convert a decimal measurement to the nearest 1/16 inch?
Multiply the decimal part by 16 and round: 0.3 x 16 = 4.8, which rounds to 5, so 0.3 inch is about 5/16 inch, 0.0125 inch over. Choose 1/16 in the inch setting and the tool gives the fraction and the error in inches and millimetres.
What is the best fraction approximation of pi?
It depends on how big a denominator you allow: 22/7 is the closest with a denominator up to 10, 311/99 up to 100 and 355/113 up to 1,000. Type 3.14159265358979 and change the denominator limit to see each one.
Can it convert a fraction back into a decimal?
Yes. Type 7/16 or a mixed number such as 2 3/8 and you get the exact decimal (0.4375, 2.375) and the percentage. If the decimal repeats, the repeating block is shown in brackets, so 1/7 appears as 0.(142857).
Last reviewed by the A2Z.Tools team against the sources listed above.