Fraction Calculator
Add, subtract, multiply, divide fractions with GCD simplification.
About the Fraction Calculator
The fraction calculator performs addition, subtraction, multiplication, and division on two fractions and returns the result in fully simplified form. Unlike decimal arithmetic, fraction arithmetic requires you to find common denominators, multiply across, or invert-and-multiply depending on the operation, and then simplify the result by dividing out the greatest common divisor. This tool automates every step while exposing the intermediate values so you can verify the work.
Fractions remain useful even in an era of cheap decimal computation because they express exact ratios. One-third is exactly 1/3 in fraction form but repeats forever as 0.3333... in decimal form. Per Euclid's Elements Book VII (Proposition 1), the Greek treatment of ratios already used the Euclidean algorithm to test whether two lengths were commensurable — the same algorithm this tool uses to simplify results today. Financial ratios, musical intervals, cooking measurements, and engineering tolerances all benefit from exact fractional representation.
The calculator accepts any integers for the numerators and denominators, including negative values. It rejects zero denominators up front and handles division by a zero fraction with a clear error message. The result is always shown in lowest terms, with any negative sign moved to the numerator by convention, and the decimal equivalent is provided alongside for cross-checking.
How It Works
Each operation uses a different formula. For addition and subtraction, the fractions are brought to a common denominator by cross-multiplying:
a/b + c/d = (a*d + c*b) / (b*d)
a/b - c/d = (a*d - c*b) / (b*d)
For multiplication, the numerators and denominators are multiplied directly:
(a/b) * (c/d) = (a*c) / (b*d)
For division, the second fraction is inverted and then multiplied:
(a/b) / (c/d) = (a*d) / (b*c)
After the arithmetic is complete, the result is simplified by computing the greatest common divisor (GCD) of the numerator and denominator using the Euclidean algorithm and dividing both by that GCD. If the denominator is negative after simplification, the sign is moved to the numerator so the fraction reads naturally. The GCD is computed iteratively: gcd(a,b) = gcd(b, a mod b) until the remainder is zero, with the last non-zero remainder being the GCD. Per Lame's theorem (1844), this algorithm terminates in at most 5 * d iterations, where d is the number of decimal digits of the smaller input, so performance is never an issue.
Worked Examples
Using the default values 3/4 + 2/5, the calculator cross-multiplies to find a common denominator of 20. The first fraction becomes 15/20 (multiply top and bottom by 5) and the second becomes 8/20 (multiply by 4). Adding the numerators gives 23/20, which is already in lowest terms since 23 is prime. The decimal equivalent is 1.15.
For multiplication, consider 3/4 * 2/5. The numerators multiply to 6 and the denominators multiply to 20, giving 6/20. The GCD of 6 and 20 is 2, so dividing both by 2 yields the simplified result 3/10, equal to 0.3 in decimal form. Notice that we did not need to find a common denominator for multiplication.
For division, 3/4 / 2/5 inverts the second fraction to give 3/4 * 5/2 = 15/8. Since 15 and 8 share no common factors (8 is a power of 2, 15 is 3 times 5), the fraction is already in simplest form. The decimal value is 1.875, an exact representation. The same cannot be said for dividing 1 by 3, which gives the repeating decimal 0.3333...
When to Use This Tool
Use the fraction calculator whenever exact ratios matter:
- Adding or subtracting cooking measurements expressed in cups, teaspoons, or fractions of an inch.
- Working with musical intervals, which are defined as exact frequency ratios (a perfect fifth is 3:2).
- Combining fractional probabilities in statistics or game theory.
- Teaching children fraction arithmetic with verifiable intermediate steps.
- Engineering and construction work where measurements use fractional inches (1-13/16 in).
- Financial ratio analysis where exact figures are preferred over rounded decimals.
- Simplifying the result of a longer pencil-and-paper fraction calculation.
Limitations & Disclaimer
This calculator works on two fractions at a time and uses integer arithmetic. Inputs that are not integers (such as 0.5) are accepted numerically but the result may not simplify cleanly. The cross-multiplication method multiplies denominators, which can overflow Number.MAX_SAFE_INTEGER for very large inputs. For symbolic or algebraic fraction manipulation, use a computer algebra system. See our disclaimer for full details.
Frequently Asked Questions
Why does the calculator simplify the result?
Because a fraction and its simplified form represent the same rational number. 6/20 and 3/10 are equal, but 3/10 is easier to read and compare. Simplifying also makes it obvious when a fraction reduces to a whole number, such as 8/4 becoming 2/1. The simplified form is the canonical representation in number theory.
What happens if I divide by a fraction with numerator zero?
Dividing by 0/c is the same as dividing by zero, since 0 divided by any non-zero c is 0. The calculator reports this as an error because division by zero is undefined. The check happens before any computation runs.
Can I use negative numerators or denominators?
Yes. The calculator accepts any integers. If the denominator ends up negative after simplification, the sign is moved to the numerator so the fraction reads naturally. For example, 3 / -4 is displayed as -3/4, and -1 / -2 is displayed as 1/2.
How does the calculator find the common denominator?
It uses the cross-multiplication method (a*d + c*b) over (b*d), which always produces a valid common denominator. It does not find the least common denominator first, but the final simplification step reduces the result to lowest terms anyway, so the output is identical.
Why does the result sometimes have a huge denominator?
Because the cross-multiplication method multiplies the two denominators, which can produce a large intermediate value. The GCD step then reduces it. For very large inputs the intermediate could overflow Number.MAX_SAFE_INTEGER (2^53 - 1), but for typical school-level problems this is not a concern.
What is the difference between a proper and improper fraction?
A proper fraction has a numerator smaller than its denominator (3/4), an improper fraction has a numerator greater than or equal to its denominator (5/4), and a mixed number combines a whole number with a fraction (1-1/4). This tool returns improper fractions rather than mixed numbers because they are easier to use in further arithmetic.
Last updated: September 9, 2026 · Author: HT99 Tools Editorial Team