Fraction to Decimal Not Working? 7 Easy Fixes, Explained cover image
Prateek Zare

Written by Prateek Zare

Software Developer with ML and Data Expertise, 8+ years of experience

Last updated
Math and Numbers

Fraction to Decimal Not Working? 7 Easy Fixes, Explained

When a fraction to decimal result looks wrong, it is almost always one of seven ordinary problems: an endless tail of digits, two answers that disagree, a mixed number read the wrong way, or a computer that quietly rounded for you. This fraction to decimal page matches each symptom to its cause and gives the fix, with the numbers worked out.

Short answerFraction to decimal is a division. A fraction either ends (like 3/4 = 0.75) or repeats forever (like 1/3 = 0.333 and so on). To get an exact answer, reduce the fraction first, check whether the denominator has only the prime factors 2 and 5, and write repeating digits in bar notation. The Fraction to Decimal Converter does the long division and marks the repeating part for you.

Seven fraction to decimal symptoms, causes and fixes

Troubleshooting table for fraction to decimal results
SymptomLikely causeFix
The decimal never stops, such as 0.3333333The fraction is a repeating decimal, which is normalWrite 0.(3) or round to the places you need
Two tools show 0.67 and 0.66 for 2/3One rounds, the other truncatesPick one rule and state it
0.333 turns into 333/1000, not 1/30.333 is a terminating decimal, a different numberEnter the repeating digit as repeating
2 3/4 gives 1.5The mixed number was multiplied, not addedUse 2 + 3/4 = 2.75
3/4 returns 0 in codeInteger division drops the remainderConvert one operand to a float first
0.1 + 0.2 shows 0.30000000000000004Binary floating point cannot store 0.1 exactlyUse exact fractions or round for display
Result shows 50/100, not 1/2The fraction was not reducedDivide top and bottom by their greatest common divisor

Fix 1: endless digits are not an error

In fraction to decimal work, divide 1 by 3 and the remainder is 1 again after every digit. The same step repeats, so the same digit repeats. The converter detects this by recording every remainder it has seen. Once a remainder shows up twice, the block of digits between the two visits is the repeating part.

Here is the rule that tells you in advance. A fraction in lowest terms ends exactly when its denominator has no prime factors other than 2 and 5. Anything else repeats. The repeat can never be longer than the denominator minus 1, because there are only that many different non zero remainders.

Fraction to decimal: terminating or repeating? Worked examples
FractionDenominator factorsDecimalType
3/42 × 20.75Ends
7/82 × 2 × 20.875Ends
3/402 × 2 × 2 × 50.075Ends
1/330.(3)Repeats, period 1
5/62 × 30.8(3)Repeats after one digit
7/122 × 2 × 30.58(3)Repeats after two digits
5/11110.(45)Repeats, period 2
1/770.(142857)Repeats, period 6
1/13130.(076923)Repeats, period 6
Reduce before fraction to decimal

18/30 has a 3 in its denominator but is not a repeating decimal. Reduced, it is 3/5 = 0.6. Always simplify first, then look at the prime factors. A GCD and LCM calculator finds the divisor for you, and a prime factorization tool shows the factors.

Enter the whole part, numerator and denominator, or go the other way from a decimal to an exact fraction. Repeating digits are detected and shown in brackets.

Open the Fraction to Decimal Converter

Fix 2: when rounding and truncating disagree

Two fraction to decimal answers that differ in the last place are usually two valid choices. Rounding looks at the next digit. Truncating cuts and ignores it. For repeating decimals the difference shows up often.

Fraction to decimal rounding against truncating
FractionExact decimal2 places rounded2 places truncated3 places rounded
2/30.(6)0.670.660.667
1/60.1(6)0.170.160.167
5/60.8(3)0.830.830.833
7/120.58(3)0.580.580.583
1/70.(142857)0.140.140.143

Which one is right? Rounding is the usual fraction to decimal rule for reporting. Truncating is sometimes required for money rules or for programs that must never overstate a value. Write which one you used.

Fix 3: decimal to fraction returns the wrong fraction

Type 0.333 into a decimal to fraction tool and you get 333/1000. That is correct for what you typed, since 0.333 has exactly three digits. It is just not 1/3. If you mean an endless 3, say so, by using the repeating option.

The algebra behind repeating decimals is short. Let x be the number, shift it by a power of ten to line up the repeat, subtract, and the repeating tail cancels.

  1. Pure repeat: x = 0.(27)The block has two digits, so multiply by 100: 100x = 27.(27). Subtract x: 99x = 27. So x = 27/99 = 3/11.
  2. Mixed repeat: x = 0.8(3)Multiply by 10 to get 10x = 8.(3), and by 100 to get 100x = 83.(3). Subtract: 90x = 75. So x = 75/90 = 5/6.
  3. Check by dividing3 ÷ 11 gives 0.2727 and so on, and 5 ÷ 6 gives 0.8333 and so on. Both match.

Related oddity: 0.(9) is exactly 1, not a number just under it. The Wikipedia article on repeating decimals explains why: 0.(9) is 9/9.

Fix 4 and 5: mixed numbers and integer division

A mixed number such as 2 3/4 means 2 plus 3/4. Convert it to an improper fraction first: 2 × 4 + 3 = 11, so 11/4, which is 2.75. Reading it as 2 times 3/4 gives 1.5, a classic slip.

In code, the trap is integer division. Many languages divide two whole numbers and throw the remainder away. For fraction to decimal in Python 3, / is true division and // for floor division, so both appear below.

Python fraction to decimal: division behaves differently by operator

print(3 / 4)     # 0.75
print(3 // 4)    # 0
print(11 / 4)    # 2.75
print(2 + 3 / 4) # 2.75
print(2 * 3 / 4) # 1.5  (the mixed number slip)

Fix 6: why 0.1 plus 0.2 is not 0.3 on a computer

Fraction to decimal on a computer is tricky because computers store most decimals in binary. A fraction ends in base 10 when its denominator is built from 2 and 5, but in base 2 it only ends when the denominator is a power of 2. So 1/10 repeats forever in binary and gets rounded when stored. Adding two such values exposes the error.

Fraction to decimal: floating point against exact fractions

print(0.1 + 0.2)
# 0.30000000000000004

from fractions import Fraction
print(Fraction(1, 10) + Fraction(2, 10))
# 3/10

The converter on this page avoids the problem for fraction to decimal work. It performs long division on whole numbers, and its decimal to fraction direction uses exact integer arithmetic instead of approximation.

Fix 7: fractions that will not simplify

In fraction to decimal work, the fraction 75/100 is right but untidy. Find the greatest common divisor with the Euclidean algorithm: 100 = 75 × 1 + 25, then 75 = 25 × 3 + 0. The divisor is 25, so 75/100 becomes 3/4. If the divisor is 1 the fraction is already in lowest terms.

Before the fix

  • 50/100
  • 0.333 read as 333/1000
  • 2 × 3/4 = 1.5
  • 3/4 = 0 in code

After the fix

  • 1/2
  • 0.(3) read as 1/3
  • 2 + 3/4 = 2.75
  • 3.0 / 4 = 0.75

Quick reference: common values

Memorise a handful and you will rarely need a tool for everyday work. The patterns also help you sanity check a result that looks off. Eighths step by 0.125, twelfths step by 0.08(3), and ninths simply repeat the numerator.

Fraction to decimal pairs you meet most often
FractionDecimalFractionDecimal
1/20.51/80.125
1/30.(3)3/80.375
2/30.(6)5/80.625
1/40.251/90.(1)
3/40.752/90.(2)
1/50.21/110.(09)
1/60.1(6)1/120.08(3)
1/100.11/200.05

Diagnostic checklist for your result

Run through this fraction to decimal check in order

Need a percentage after fraction to decimal? A percentage calculator turns 0.75 into 75% in one step.

Which fraction is exactly equal to 0.(142857)?

The block has six digits, so multiply by 1,000,000 and subtract: 999999x = 142857. Dividing both by 142857 gives x = 1/7.

Frequently asked questions

How do I convert a fraction to a decimal?

Divide the numerator by the denominator. For 3/4 that is 3 ÷ 4 = 0.75. If the division never ends, the decimal repeats.

Why does fraction to decimal for 1/3 give 0.3333 and never stop?

Each step of long division leaves a remainder of 1, so the same digit 3 comes out again and again. The exact value is written 0.(3).

How can I tell if a fraction terminates?

Reduce it to lowest terms, then factor the denominator. If only 2 and 5 appear, the decimal ends. Otherwise it repeats.

What is 5/6 in fraction to decimal form?

It is 0.8333 and so on, written 0.8(3). The 8 appears once and the 3 repeats forever.

How long can the repeating part be?

For a denominator k, the repeating block is never longer than k minus 1 digits. For 1/7 it is exactly 6 digits.

Is 0.999 repeating equal to 1?

Yes. Written as a fraction, 0.(9) is 9/9, which is 1. It is another way to write the same number.

Sources: Wikipedia: Repeating decimal