Fraction Calculator

Pick an operation, enter two fractions, and the calculator returns the exact answer in lowest terms — along with the decimal value, mixed-number form, and the unsimplified intermediate so you can follow the working.

#math#fractions#arithmetic#rational-numbers

Result (simplified)

3/4 + 2/5 = 23/20

Decimal value
1.15
Mixed number
1 3/20
Before simplifying
23/20
First fraction in lowest terms
3/4
Second fraction in lowest terms
2/5

Fractions are combined using the standard rules of rational arithmetic, then divided through by the greatest common divisor of the numerator and denominator to land in lowest terms (Hardy & Wright, ch. 6). The decimal value is shown for sanity-checking; the simplified fraction is the exact answer.

How to use this calculator

Enter a whole-number numerator and denominator for each fraction, then choose an operation: add, subtract, multiply, or divide. The calculator updates as you type and shows the simplified result, its decimal value, and — when the result is greater than 1 — the equivalent mixed number. Negative numbers are accepted on either field; the sign is carried to the numerator of the simplified output. Denominators must be non-zero. To divide, the second numerator must also be non-zero (you cannot divide by zero).

How the calculation works

The four operations follow the standard identities for rational arithmetic. For addition and subtraction the two fractions are first put over their common denominator b·d, giving (a·d ± b·c)/(b·d). Multiplication is the entry-wise product (a·c)/(b·d). Division multiplies by the reciprocal: (a/b) ÷ (c/d) = (a·d)/(b·c). Whichever operation you pick, the resulting numerator and denominator are then divided through by their greatest common divisor (computed by the Euclidean algorithm) to give the answer in lowest terms. Because the inputs are whole numbers, every intermediate stays an integer — no floating-point rounding is involved in the exact answer; the decimal shown is just for cross-checking.

Worked example

To add 3/4 + 2/5: rewrite over the common denominator 4 × 5 = 20 → (3 × 5 + 4 × 2)/20 = (15 + 8)/20 = 23/20. The gcd of 23 and 20 is 1, so 23/20 is already in lowest terms. As a decimal that is 1.15, and as a mixed number 1 3/20. To multiply 3/4 × 2/5: (3 × 2)/(4 × 5) = 6/20; gcd(6, 20) = 2, so the simplified answer is 3/10 = 0.3. To divide 3/4 ÷ 2/5: invert the divisor and multiply → 3/4 × 5/2 = 15/8; gcd(15, 8) = 1, so the answer is 15/8 = 1.875 = 1 7/8.

Frequently asked questions

Why does the calculator only accept whole numbers?

Fraction arithmetic is exact only when the inputs are integers — every step of addition, subtraction, multiplication and division stays in the integers and the simplified result is therefore precise. If decimals were accepted, every input would have to be converted to an exact rational first (e.g. 0.1 → 1/10) and that conversion is not always the answer you expect (binary floats like 0.1 are not exactly representable). If you have decimals, multiply through by an appropriate power of 10 to clear them — for example 0.25 = 25/100 = 1/4 — and use those integers as inputs.

How is the fraction simplified to lowest terms?

The numerator and denominator are divided through by their greatest common divisor, found by the Euclidean algorithm: repeatedly replace the larger by its remainder when divided by the smaller until the remainder is zero. For example 15/20 → gcd(15, 20) = 5 → divide both by 5 → 3/4. A fraction is in lowest terms exactly when its numerator and denominator are coprime (gcd equals 1). The Euclidean algorithm is the same one used inside every standard mathematics library for rational arithmetic.

What happens when I enter a negative number?

Negative fractions are handled. By convention the calculator carries the sign on the numerator of the simplified result and keeps the denominator positive, so −3/4 and 3/−4 are both displayed as −3/4. This matches the convention used in textbooks and in computer-algebra systems such as SymPy and Mathematica. Subtraction and division work as expected on negatives — for example (−1/2) − (1/3) = −5/6, and (−3/4) ÷ (1/2) = −3/2.

Why does it sometimes show a mixed number and sometimes not?

A mixed number is the standard way to display an improper fraction — one where the numerator is at least as large as the denominator in absolute value — by separating out the whole-number part. So 15/8 is shown as 1 7/8, but 3/4 stays as a proper fraction (the whole part is 0). When the result is a whole number (denominator 1 after simplifying), the mixed-number field shows the whole value rather than a redundant "n 0/1" form. The simplified fraction is always the same number — mixed-number form is purely for human readability.

Can the calculator handle dividing by zero?

No — and it should not. Dividing by zero is undefined in the rationals, so the calculator returns an "Invalid input" message rather than a numeric result. There are two ways this can happen: a fraction with denominator zero (e.g. 3/0) is itself undefined, and dividing by a fraction whose numerator is zero (e.g. (3/4) ÷ (0/5)) is dividing by zero in disguise. Both cases are flagged with a specific message so you can fix the input.

How is dividing fractions related to multiplying?

Dividing by a fraction is the same as multiplying by its reciprocal — the rule you may know as "keep, change, flip". To divide a/b by c/d, keep the first fraction, change the division to multiplication, and flip the second fraction to d/c: (a/b) ÷ (c/d) = (a/b) × (d/c) = (a·d)/(b·c). This works because every non-zero rational c/d has a multiplicative inverse d/c, so division is just multiplication by that inverse. The calculator uses this identity internally — dividing 3/4 by 2/5 is computed as 3/4 × 5/2 = 15/8.