What this calculator does
Turn any decimal into an exact fraction, or any fraction into its exact decimal. A fraction of whole numbers always becomes a decimal that either stops (3/8 = 0.375) or repeats. A repeating decimal settles into a block of digits that goes on forever (5/12 = 0.41666…). Going the other way, every decimal that stops or repeats can be written as an exact fraction. This converter works in both directions without rounding along the way.
Decimals are read as text, digit by digit. So 0.3 becomes exactly 3/10, not the long, slightly-off value a computer stores in binary. For repeating decimals, put the repeating block in parentheses: 0.(3) is 0.333…, and 0.1(6) is 0.1666…. In the other direction, the calculator does long division. It watches the remainders and marks the block that repeats.
Where it's used
Why this math matters outside the classroom:
- Tape measures. A carpenter converts 0.375 inches to 3/8 inch to find the mark on a tape measure.
- Recipes. A cook reads 0.333… cups as exactly 1/3 cup, because a repeating 3 is equal to one third.
- Drill bits. A machinist converts a 5/16 inch drill bit to 0.3125 inches to compare it with other bit sizes.
- Batting averages. A player with 7 hits in 22 at-bats has 7/22 = 0.31818…, with the 18 repeating, shown as .318.
- Money. Shoppers see that 3/4 of a dollar is 0.75, or 75 cents, by dividing 3 by 4.
Grade level and standards: Grades 7–8; Common Core State Standards for Mathematics 7.NS.A.2.d, 8.NS.A.1. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose the direction: decimal to fraction, or fraction to decimal.
- For a decimal, type it as written. Wrap any repeating digits in parentheses, such as 2.(45) or 0.08(3).
- For a fraction, enter a whole-number numerator (top number) and a denominator (bottom number) that isn't zero.
- Read the exact answer, then follow the steps to see how the calculator got there.
What the inputs mean
- Decimal
- Up to 14 significant digits (digits not counting leading zeros). Only the digits inside the parentheses repeat: 0.1(6) is 0.16666…, while 0.(16) is 0.161616…. A minus sign in front is fine. Don't type '…' or extra digits to show repetition. Use the parentheses.
- Numerator
- Any whole number, positive, negative or zero.
- Denominator
- Any whole number other than zero, up to 1,000,000 in size. A negative denominator just makes the whole value negative.
Formula and method
Terminating: 0.d₁d₂…dₖ = (digits) / 10^k Repeating: x = I.N(R), with k digits in N and r digits in R 10^(k+r) · x − 10^k · x = INR − IN x = (INR − IN) / (10^(k+r) − 10^k) a/b terminates ⇔ the reduced b has no prime factors other than 2 and 5
x is the decimal you're converting. I is its whole-number part, N is the digits after the point that don't repeat and R is the repeating block. k counts the digits in N, and r counts the digits in R. In the last line, a/b is a fraction with top a and bottom b.
A terminating decimal (one that stops) is its digits over a power of ten: 0.375 is 375/1000. Divide top and bottom by their greatest common divisor (the biggest number that divides both), 125, to get 3/8.
A repeating decimal is handled by shifting it twice. Multiplying by 10^(k+r) moves the non-repeating digits and one full repeating block in front of the point. Multiplying by 10^k moves only the non-repeating digits. Both results have the same endless tail. So subtracting them leaves a whole number, and x is that whole number over 10^(k+r) − 10^k. Here INR means all those digits read as one whole number, and IN means the same without the repeating block.
For fraction to decimal, each step of long division multiplies the remainder by 10 and divides again. There are only b − 1 possible remainders other than zero. So either a remainder hits 0 and the decimal stops, or one comes back. From that point on, the same digits repeat.
Worked example
A measurement reads 0.1666… with the 6 repeating forever. What fraction is it?
- Write it as 0.1(6) and call it x. There is k = 1 non-repeating digit (1) and r = 1 repeating digit (6).
- Multiply by 10^2 = 100: 100x = 16.(6).
- Multiply by 10^1 = 10: 10x = 1.(6).
- Subtract: 90x = 16 − 1 = 15, so x = 15/90.
- The GCD of 15 and 90 is 15, so 15/90 reduces to 1/6.
Result: 0.1(6) = 1/6. In the other direction, entering 5/12 gives 0.41(6). After the third decimal place, the remainder 8 comes back, so the 6 repeats forever.
Understanding the result
The fraction is always exact and in lowest terms. For values larger than 1, you'll also see it as a mixed number, like 2 1/2. The rounded decimal follows your precision setting.
In fraction-to-decimal mode, the exact decimal puts the repeating block in parentheses, and you'll see how long that block is. A block longer than 60 digits is shortened with '…', but its full length is still given.
Assumptions and limitations
- Parentheses mark the repeating block. Everything else in the decimal is taken exactly as typed.
- A repeating block of zeros, such as 0.5(0), is treated as a decimal that stops.
- Fractions are reduced before converting, which doesn't change the decimal.
- Decimals are limited to 14 significant digits, and denominators to 1,000,000. That way every number in the working stays exact.
- Irrational numbers such as π or √2 never stop or repeat, so they have no exact fraction. Entering 3.14159 gives the fraction for that rounded value, not for π.
- Thousands separators (like the comma in 1,000) and scientific notation (like 1e5) aren't accepted in the decimal field.
Frequently asked questions
Is 0.999… really equal to 1?
Yes. Use the subtraction method. x = 0.(9) gives 10x = 9.(9). Subtracting leaves 9x = 9, so x = 1. Two different ways of writing a decimal can name the same number, just as 1/2 and 2/4 do.
Why does 1/3 never end as a decimal?
Our decimal system is built on tens, and 10 = 2 × 5. A reduced fraction can only end if its denominator divides evenly into some power of ten. That means its only prime factors are 2 and 5. Since 3 is neither, the remainders in the long division keep cycling, and the digits repeat.
How long can the repeating block be?
For a reduced fraction a/b, it's at most b − 1 digits. Denominators such as 7, 17 and 97 reach that limit. 1/7 has a 6-digit block, and 1/97 has a 96-digit block.
What is the difference between 0.1(6) and 0.(16)?
The parentheses mark exactly which digits repeat. 0.1(6) is 0.16666… and equals 1/6. 0.(16) is 0.161616… and equals 16/99.
How this calculator is checked
Method: Standard place-value conversion for terminating decimals, the shift-and-subtract method for repeating decimals, and long division with remainder tracking for fractions. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Fraction and Decimal Converter on your own website or blog for free. Paste this code where you want it to appear: