What converting a fraction to a decimal actually does
A fraction and a decimal are two ways of writing the same number, and the conversion between them is a single division: the fraction bar is a division sign. 5/12 means 5 divided by 12, and carrying out that division gives 0.41666…
The reason the two notations feel different is that decimals are locked to powers of ten. A decimal with three places is a count of thousandths; with five places, a count of hundred-thousandths. So a fraction converts to a finite decimal only if it can be rewritten with a denominator that is a power of ten. 7/16 can: multiply top and bottom by 625 and you get 4375/10000, which is 0.4375. But 1/3 cannot, because no whole number times 3 is ever a power of ten, and no amount of long division will change that.
What happens instead is that the division falls into a loop. Every step of a long division leaves a remainder smaller than the divisor, so with divisor b there are only b possible remainders. Keep going and either a remainder of zero turns up, ending the decimal, or a remainder repeats — and once a remainder repeats, every digit after it repeats too, forever, in the same order. That is the whole explanation for repeating decimals, and it also puts a hard ceiling on the repeat length: no more than b − 1 digits.
Every fraction of whole numbers therefore converts to a decimal that either stops or repeats. Nothing else is possible. Decimals that neither stop nor repeat, such as π and √2, are precisely the numbers that are not fractions of whole numbers.
The test for terminating or repeating, and where the period comes from
You can tell whether a decimal will stop without doing any division at all. Reduce the fraction first, then look at the prime factors of the denominator.
The terminating test. A reduced fraction has a terminating decimal exactly when its denominator's only prime factors are 2 and 5 — the primes that divide ten. So 1/8, 3/20, 7/16 and 9/250 all stop, while anything with a 3, 7, 11, 13 or larger prime surviving in the denominator does not. Reduce first or the test lies to you: 15/24 looks doomed by the 3 in 24, but it reduces to 5/8 and terminates at 0.625.
How many fixed places. Write the reduced denominator as 2m·5n·t, where t holds every other prime factor. The decimal has exactly max(m, n) places before any repeat starts. For 1/8 = 1/2³, that is three places: 0.125. For 5/12 = 5/(2²·3), it is two places, so the repeat begins at the third decimal: 0.41(6).
How long the repeat is. The length of the repeating block — the period — is the smallest whole number k for which 10k leaves a remainder of 1 when divided by t. Number theorists call this the multiplicative order of 10 modulo t. For t = 3, 10 itself already leaves remainder 1, so the period is 1 and you get 0.(3). For t = 7, you have to reach 106 = 999999 = 7×142857 before the remainder is 1, so the period is 6 and you get 0.(142857).
Two consequences fall straight out of that. The period can never exceed t − 1. And the repeating block, read as a whole number, always divides a string of nines: 142857 × 7 = 999999. That identity is the basis for converting a repeating decimal back into a fraction, which the decimal to fraction calculator handles.
Worked example: 5/12 by hand, and why it repeats
Step 1: reduce. gcd(5, 12) = 1, so 5/12 is already in lowest terms.
Step 2: factor the denominator. 12 = 2² × 3. Written as 2m·5n·t that is m = 2, n = 0, t = 3. Since t is not 1, the decimal repeats.
Step 3: count the fixed places. max(2, 0) = 2, so two digits appear before the repeat begins.
Step 4: find the period. The smallest k with 10k ≡ 1 (mod 3): 10 ÷ 3 leaves remainder 1 immediately, so k = 1. The repeating block is one digit long.
Step 5: do the long division. Start with 5 as the remainder.
- Bring down a zero: 50. 50 ÷ 12 = 4, remainder 50 − 48 = 2. First digit: 4.
- Bring down a zero: 20. 20 ÷ 12 = 1, remainder 20 − 12 = 8. Second digit: 1.
- Bring down a zero: 80. 80 ÷ 12 = 6, remainder 80 − 72 = 8. Third digit: 6.
- The remainder 8 has already appeared, so step 3 will repeat identically from here on. Every further digit is a 6.
Step 6: write it. 5/12 = 0.41666… = 0.41(6), where the bracket marks the block that repeats. The prediction from steps 3 and 4 — two fixed digits, then a one-digit repeat — is exactly what the division produced.
Step 7: round. To four places, look at the fifth digit (6), which is 5 or more, so round the fourth up: 0.4167. As a percentage, multiply by 100: 41.6667%.
How to read the result, and how many places you actually need
The exact decimal is the answer; the rounded one is a presentation choice. Round only at the very end of a calculation, never in the middle, because a rounded value carries an error that every subsequent multiplication magnifies.
How many places to keep depends on what the number is for. A machinist working from a drawing dimensioned in sixteenths converts to four decimal places because standard shop tolerances are quoted in thousandths and ten-thousandths, and every sixteenth converts exactly at four places anyway — 1/16 = 0.0625, no rounding involved. A student answering a homework question follows whatever the question specifies. A programmer should usually not convert at all: 1/3 has no finite binary representation either, so storing it as a floating-point number introduces the same class of error, and keeping the numerator and denominator as integers avoids it.
If your rounded decimal ends in a run of 9s or a run of 0s, check the exact form before you trust it. 0.4999999 to two places is 0.50, and 1/3 rounded to two places is 0.33 — but 0.33 × 3 = 0.99, not 1. That gap is not an error in the rounding; it is the price of leaving the exact form.
The percentage output is the decimal times 100 and follows the same rules: 5/12 is 41.6667% to four places, and exactly 41.(6)%. For percentage problems in their own right, use the percentage calculator.
Inch fractions as decimals — the shop chart
| Fraction | Decimal | Fraction | Decimal |
|---|---|---|---|
| 1/16 | 0.0625 | 9/16 | 0.5625 |
| 1/8 | 0.1250 | 5/8 | 0.6250 |
| 3/16 | 0.1875 | 11/16 | 0.6875 |
| 1/4 | 0.2500 | 3/4 | 0.7500 |
| 5/16 | 0.3125 | 13/16 | 0.8125 |
| 3/8 | 0.3750 | 7/8 | 0.8750 |
| 7/16 | 0.4375 | 15/16 | 0.9375 |
| 1/2 | 0.5000 | 1 | 1.0000 |
Thirty-seconds and sixty-fourths also terminate, at five and six places respectively: 1/32 = 0.03125 and 1/64 = 0.015625.
Common repeating decimals and their periods
| Fraction | Exact decimal | Fixed places first | Period |
|---|---|---|---|
| 1/3 | 0.(3) | 0 | 1 |
| 2/3 | 0.(6) | 0 | 1 |
| 1/6 | 0.1(6) | 1 | 1 |
| 1/7 | 0.(142857) | 0 | 6 |
| 1/9 | 0.(1) | 0 | 1 |
| 1/11 | 0.(09) | 0 | 2 |
| 5/12 | 0.41(6) | 2 | 1 |
| 1/13 | 0.(076923) | 0 | 6 |
1/7 and 1/13 both have period 6, which is why 142857 and 076923 each multiply by their denominator to give 999999.
Mistakes and misreadings to avoid
- Applying the terminating test before reducing. 15/24 has a 3 in the denominator but reduces to 5/8 and terminates at 0.625. Always reduce first.
- Reading 0.41(6) as 0.41 followed by 6. The parentheses mark the block that repeats forever: 0.4166666…, not 0.416.
- Treating a rounded decimal as exact. 1/3 is not 0.333, and multiplying 0.333 by 3 gives 0.999. Keep the fraction until the last step.
- Dividing the wrong way round. 3/4 is 3 ÷ 4 = 0.75, not 4 ÷ 3 = 1.333. The numerator goes inside the division.
- Assuming a long denominator means a long repeat. 1/101 has period 4, while 1/17 has period 16. Period length depends on the order of 10 modulo the denominator, not on the denominator's size.
- Forgetting the sign. −3/8 is −0.375. The sign attaches to the whole value, not to the digits after the point.
- Converting when you did not need to. In a spreadsheet or a program, keeping numerator and denominator as integers preserves exactness that any decimal form loses.
Notation for the repeating block
Three notations are in common use for the same thing. A vinculum, or overbar, over the repeating digits is the usual convention in United States textbooks: 0.41 with a bar drawn over the final 6. A dot over the first and last digit of the block is the standard in British and Commonwealth schools. Parentheses around the block, as used on this page, are common in continental Europe and in computing, and they survive being copied and pasted as plain text, which the other two do not.
All three mean exactly the same number. If you are writing an answer for marking, use whichever your course uses.
Related conversions and where this fits
The reverse direction — decimal to fraction — is straightforward for a terminating decimal: 0.4375 is 4375/10000, which reduces to 7/16. For a repeating decimal it needs the nines identity: 0.(142857) equals 142857/999999, which reduces to 1/7. The decimal to fraction calculator handles both cases.
If you need the fraction reduced before converting, the simplifying fractions calculator does that step, and the greatest common factor calculator gives the divisor it uses. If your fraction arrived as a mixed number, convert it with the mixed number to improper fraction calculator first — this page assumes a single numerator over a single denominator.
Rounding deserves its own attention when the result feeds a report or a specification. Significant figures and decimal places are different rules and give different answers for the same number, and standards bodies differ on how to handle a digit of exactly 5. The rounding numbers calculator and the significant figures calculator cover those conventions. This page rounds half-up, which is the convention taught in most schools.
