Two directions, one page
How to use both directions
Choose a direction in the picker above the calculator. In Decimal → fraction, type a finite decimal such as 0.75 and read the reduced fraction 3/4, the mixed number when there is a whole part, the fraction before reduction, and the greatest common divisor. In Fraction → decimal, enter a numerator and a denominator such as 5 and 8 and read the decimal, the reduced fraction, the mixed number, and whether the decimal terminates or repeats.
The two directions keep separate inputs, so switching back and forth does not erase what you typed. Each opens with an editable example: 0.75 in decimal mode and 5/8 in fraction mode. Reset values returns both directions to those examples, and the URL stores the mode, the decimal, the numerator, and the denominator, so a shared link restores the same view.
The decimal answer is the only value that can be rounded. A reduced fraction is always exact, and a terminating decimal is shown with every digit it needs. A repeating decimal is marked with ≈ and, when the cycle is short enough, printed with the repeating block in parentheses.
Decimal to fraction formula
A finite decimal carries a fixed number of places. Write its digits over the matching power of ten, then divide the numerator and denominator by their greatest common divisor.
p = number of decimal placesdecimal = digits ÷ 10^pg = gcd(|digits|, 10^p)fraction = (digits ÷ g) ÷ (10^p ÷ g)Mixed numberwhole = numerator ÷ denominator; remainder over denominator0.75 has two places: 75/100. The greatest common divisor of 75 and 100 is 25, so both parts divide by 25 to give 3/4. The same rule handles 0.125 = 125/1000 = 1/8 and 2.5 = 25/10 = 5/2, which is 2 1/2 as a mixed number.
Trailing zeros do not change the value. 0.750 and 0.75 are the same number; the calculator drops the trailing zero, reads 75/100, and reduces it to 3/4. A leading zero before the decimal point does not affect the numerator either. A negative decimal keeps its sign in the numerator: −0.75 = −75/100 = −3/4, with the denominator left positive.
This direction only accepts a finite decimal. A repeating value such as 0.333… cannot be typed as an exact decimal, because the number of places would never end. Use the fraction direction for a repeating value.
Worked example: 0.75 → 3/4
The default decimal is 0.75. It has two places, so the denominator is 100, and the fraction reduces by 25.
| Decimal places | 2 → denominator 100 |
|---|---|
| Write over 100 | 75/100 |
| Greatest common divisor | gcd(75, 100) = 25 |
| Reduce both parts | 75 ÷ 25 = 3; 100 ÷ 25 = 4 |
| Simplified fraction | 3/4 |
| Mixed number | Not applicable; 3/4 is less than 1 |
| Decimal check | 3 ÷ 4 = 0.75 exactly |
The fraction is proper, so the mixed-number cell shows a dash rather than repeating 3/4. A decimal such as 1.75 has a whole part: 175/100 reduces by 25 to 7/4, and 7 ÷ 4 gives 1 remainder 3, so the mixed number is 1 3/4.
In the other direction, 5/8 is already reduced because gcd(5, 8) = 1. Dividing 5 by 8 gives 0.625, and the reduced denominator 8 = 2³ has no prime factor other than 2, so the decimal terminates after three places with nothing to round.
Fraction to decimal: terminating or repeating
A fraction is a division: numerator ÷ denominator. Reduce the fraction first, then look at the prime factors of the reduced denominator. If the only factors are 2 and 5, the decimal terminates; any other prime factor makes the decimal repeat.
reduced denominator = 2^a × 5^b → terminatingdecimal places = max(a, b)other prime factor present → repeating| Fraction | Decimal |
|---|---|
| 5/8 | 0.625 exact (2³, 3 places) |
| 7/4 | 1.75 exact (2², 2 places) |
| 1/3 | 0.(3)… repeating |
| 5/6 | 0.8(3)… repeating |
| 2/7 | 0.(285714)… repeating, 6-digit cycle |
The calculator performs the long division and tracks remainders. When a remainder repeats, the digits between the two occurrences form the repeating cycle, which is printed in parentheses: 5/6 = 0.8(3)… means the 3 continues forever, and 2/7 = 0.(285714)… means the six-digit block repeats. Because a repeating decimal has no exact finite form, the display is rounded to 12 decimal places and marked with ≈.
Some cycles are far longer than any practical display. The scan covers the first 36 decimal digits; if no remainder repeats by then, the result is still labelled repeating, but the cycle itself is not printed. An integer result, such as 8/4 = 2, terminates immediately because the reduced denominator is 1.
Input rules and precision
- Decimal input. Digits and one decimal point, with up to 10 decimal places and a magnitude up to 1,000,000. Fractions, commas, and exponents are rejected rather than guessed at.
- Repeating decimals. A typed decimal is treated as an exact terminating value. 0.3333333333 becomes 3333333333/10000000000, not 1/3; use the fraction direction for a repeating value.
- Fraction input. The numerator is a whole number from −1,000,000 to 1,000,000; the denominator is a whole number from 1 to 1,000,000. A zero denominator is refused, and the minus sign belongs on the numerator, not the denominator.
- No mixed-number entry. Enter an improper fraction instead: 2 1/2 becomes 5/2. The result panel converts it back to a mixed number for display.
- Exact versus rounded. Terminating decimals are shown exactly. Repeating decimals are rounded to 12 decimal places, and their cycle is shown only when it is found within 36 digits.
- Reduction. Both directions reduce with the greatest common divisor, so the fraction shown has no common factor left in its numerator and denominator.
For most measurement and money tasks the rounded decimal is enough. When a result has to be multiplied or divided again, keep the fraction: the reduced fraction is exact, while a rounded repeating decimal accumulates a small error at each step.
Decimal and fraction FAQs
Why is 0.3333333333 not converted to 1/3?
0.3333333333 has ten decimal places, so the calculator reads it as exactly 3333333333/10000000000. That fraction is not 1/3, and no finite decimal is. Repeating decimals are not treated as exact input; switch to Fraction → decimal and enter 1/3 to see the repeating decimal 0.333333333333…, which is marked with ≈.
Can I type a mixed number such as 2 1/2?
Not directly. The fraction direction takes a whole-number numerator over a whole-number denominator, so convert the mixed number to an improper fraction first: 2 1/2 = 5/2. Enter 5 and 2, and the result panel converts the answer back to the mixed number 2 1/2 alongside the decimal 2.5.
Does 5/8 really equal 0.625 exactly?
Yes. The reduced denominator 8 is 2³, so the decimal terminates after three places: 5 ÷ 8 = 0.625. There is no rounding, and the result carries no ≈ sign. A fraction whose reduced denominator has any prime factor other than 2 or 5, such as 5/6, produces a repeating decimal instead.
What happens when a repeating cycle is extremely long?
The calculator scans the long division for a repeated remainder over the first 36 decimal digits. Short cycles such as 1/7 = 0.(142857)… are shown in parentheses. If the cycle is longer than that, the result is still labelled repeating and the decimal is rounded to 12 places, but the full cycle is not printed.