Math

Fraction calculator

Add, subtract, multiply or divide two fractions, with simplification.

01Inputs
02Results
Simplified result
before reduction
Decimal
As percentage
Mixed number

Addition / subtraction use a common denominator (A·d B + B·d A) / (d A · d B), then reduce by the GCD. Multiplication: numerators × numerators, denominators × denominators. Division: multiply by the reciprocal.

03How it works

Why this calculation

Fractions are the gateway from arithmetic to algebra, and the operation people forget fastest after school. Recipe scaling, woodworking measurements, splitting bills, electronics resistor combinations, and engineering tolerances all require fraction arithmetic. The four basic operations — addition, subtraction, multiplication, division — each have a different procedure (common denominator vs straight multiply vs reciprocal), and forgetting which leads to predictable errors. A calculator that does the bookkeeping (find LCM, multiply, simplify by GCD) and shows the result in three forms (improper fraction, mixed number, decimal, percentage) lets you focus on the meaning instead of the mechanics.

The formula

For two fractions a/b and c/d:

  • Addition: a/b + c/d = (a·d + c·b) / (b·d). Common denominator is b·d (or LCM, but b·d works and reduces later).
  • Subtraction: a/b − c/d = (a·d − c·b) / (b·d).
  • Multiplication: a/b × c/d = (a·c) / (b·d). Numerators multiply, denominators multiply.
  • Division: a/b ÷ c/d = a/b × d/c = (a·d) / (b·c). "Multiply by the reciprocal."

After computing the raw numerator and denominator, the calc reduces by their GCD (Euclidean algorithm). It also handles negative denominators by flipping signs to keep the canonical form (positive denominator).

The result is shown four ways: - Simplified fraction: 5/6, 2/3, etc. - Decimal: 0.6667, 1.25, etc. - Percentage: 66.67 %, 125 %, etc. - Mixed number: integer + proper fraction (e.g. 11/4 → 2 ¾).

How to use

Fill the four numbers — numerator A, denominator A, numerator B, denominator B — and pick the operation: +, −, ×, ÷. Negative numerators are accepted (and propagate through the operations). A zero denominator is rejected; a zero numerator is fine (results in 0). The result panel shows all four representations simultaneously.

Worked example

1/2 + 1/3: - Common denominator: 2 × 3 = 6. - Sum: 1·3 + 1·2 = 5. Denominator: 6. Raw result: 5/6. - GCD(5, 6) = 1, already reduced. - Decimal: 0.8333. Percentage: 83.33 %. Mixed: 5/6 (proper, no whole part).

3/4 × 2/5: - Numerators: 3 × 2 = 6. Denominators: 4 × 5 = 20. Raw: 6/20. - GCD(6, 20) = 2. Reduced: 3/10. - Decimal: 0.3. Percentage: 30 %.

5/6 − 1/4: - Common denominator: 24. Numerator: 5·4 − 1·6 = 14. Raw: 14/24. - GCD = 2. Reduced: 7/12. - Decimal: 0.5833.

Pitfalls

Mixed-number input not supported. The calc takes only proper or improper fractions (numerator/denominator). For a mixed number like 1 ¾, convert first: whole × denom + num = 1 × 4 + 3 = 7, so 1 ¾ = 7/4.

Floating-point input. The calc takes integer numerators and denominators. If you enter a decimal it's truncated by the input parser to an integer — convert your decimal to a fraction first (0.25 = 1/4, 0.333 ≈ 1/3 if you want exact).

Negative denominator. Internally the calc canonicalizes to positive denominator (a/(−b) → −a/b). The output's "raw" line shows the un-simplified form so you can audit the arithmetic; the "simplified" line is the canonical representation.

Division by zero. If denominator B is zero (or zero appears mid-calculation in division when numerator B = 0), the calc returns "–". Always check denominators are non-zero.

GCD with negative numbers. The Euclidean algorithm here uses absolute values for GCD; the sign of the result is preserved through normalization (negative numerator, positive denominator).

Improper-fraction interpretation. A result like 7/4 is "improper" but mathematically valid. Some math curricula (US elementary school) require expressing it as a mixed number; engineering and higher math prefer improper. The calc shows both.

Decimal precision. The decimal representation shows up to ~10 significant digits via JS number formatting. For exact arithmetic with large numerators/denominators, the simplified fraction is the canonical form — the decimal can be a periodic non-terminating expansion.

Percentage interpretation. The percentage = decimal × 100 — useful for converting fractions to "share of a whole" but doesn't apply when a fraction represents a ratio (e.g., 16:9 aspect ratio shouldn't be expressed as 178 %).

Operator precedence. The calc handles only one operation at a time. For multi-step expressions like 1/2 + 1/3 × 1/4, follow PEMDAS: do the multiplication first (1/3 × 1/4 = 1/12), then add (1/2 + 1/12 = 7/12). Or use a chain of two calc operations.

Variations

  • Fraction-to-decimal: just the decimal output of this calc (set the operation to + and the second fraction to 0/1).
  • Decimal-to-fraction: continued-fraction algorithm — out of scope here.
  • Continued fraction representation: e.g. π ≈ 22/7 (low precision) or 355/113 (high precision). Different math.
  • Modular arithmetic: fractions mod prime — number theory, not basic arithmetic.
  • Algebraic fractions: with variables. Use a CAS like SymPy or Wolfram Alpha.
  • Egyptian-fraction representation: any positive rational decomposed into a sum of distinct unit fractions; classical number-theory exercise, not relevant to everyday arithmetic.
  • Fraction-arithmetic in code: Python's fractions.Fraction, JavaScript's BigRat libraries, and Mathematica's Rational[] all maintain exact arithmetic without floating-point drift — useful when chaining many operations together for an exact answer at the end.

Related calculators