Mathematics · Number Theory
Fraction Calculator
Add, subtract, multiply, and divide two fractions with automatic simplification to lowest terms.
Calculator
Formula
a and c are numerators; b and d are denominators. Results are simplified using the greatest common divisor (GCD).
Source: Standard arithmetic — elementary number theory.
How it works
For addition and subtraction the calculator finds a common denominator by multiplying both denominators together, adjusts both numerators accordingly, then combines them. For multiplication it multiplies numerators together and denominators together; for division it multiplies the first fraction by the reciprocal of the second.
After computing the raw result, the calculator finds the Greatest Common Divisor (GCD) of the numerator and denominator using the Euclidean algorithm and divides both by it, ensuring the fraction is fully reduced to its lowest terms.
Worked example
Example: 1/2 + 1/3 (operation = 1)
Step 1 — Common denominator: 2 × 3 = 6.
Step 2 — Adjust numerators: (1×3) + (1×2) = 3 + 2 = 5.
Step 3 — Raw result: 5/6.
Step 4 — GCD(5, 6) = 1, so the fraction is already fully reduced.
Final answer: 5/6 ≈ 0.833333.
Limitations & notes
This calculator works with integer numerators and denominators only — decimal inputs are rounded to the nearest whole number before calculation. Very large integers may exceed JavaScript's safe integer range, causing precision loss. Division by zero (entering 0 as any denominator, or 0 as the second numerator when dividing) is undefined and returns no result. Mixed numbers must be converted to improper fractions before entry.
Frequently asked questions
How do I enter a mixed number like 2 and 1/2?
Convert it to an improper fraction first: 2 and 1/2 = (2×2+1)/2 = 5/2. Enter 5 as the numerator and 2 as the denominator.
What operation numbers should I use?
Enter 1 for addition, 2 for subtraction, 3 for multiplication, and 4 for division.
Why does the result show a numerator and denominator separately?
Showing both parts lets you read the exact fractional result (e.g., 5/6) alongside the decimal equivalent. This is more precise than a decimal alone for repeating fractions.
Can I use negative fractions?
Yes — enter a negative numerator (e.g., -3 over 4) and the calculator handles the sign correctly, always keeping any negative sign on the numerator.
What does 'lowest terms' mean?
A fraction is in lowest terms when its numerator and denominator share no common factors other than 1, for example 2/4 simplified to 1/2.
Last updated: 2025-01-15 · Formula verified against primary sources.