Fraction Calculator
Adds, subtracts, multiplies or divides two fractions entered as whole-number numerators and denominators, using exact integer arithmetic with cross-multiplication rules such as ad plus cb over bd and reduction by the greatest common divisor via the Euclidean algorithm. Returns the result as a fully reduced fraction, a mixed number when improper, and a decimal rounded to six places, with negative inputs allowed and the sign placed on the numerator.
Enter two fractions, choose an operation, and the calculator returns the exact answer three ways: a fully reduced fraction, a mixed number when the result is improper, and a decimal rounded to six places. Every step uses whole-number arithmetic, so 1/10 + 1/5 comes out as exactly 3/10 rather than the 0.30000000000000004 that floating-point addition produces. Negative values are allowed in any field, and the sign always ends up on the numerator.
Worked example with the defaults
The form starts with 3/4 + 2/5. Quarters and fifths are different-sized pieces, so they cannot be combined directly. The calculator rewrites both over a common denominator — the product 4 × 5 = 20 — using the standard rule:
a/b + c/d = (ad + cb) / bd
Substituting gives (3 × 5 + 2 × 4) / 20 = (15 + 8) / 20 = 23/20. The numerator 23 is prime, so nothing cancels. As a mixed number that is 1 3/20, and as a decimal 1.15.
Why a common denominator is required
A fraction counts equal parts, and only like parts can be counted together. Three quarters plus two fifths becomes 15 twentieths plus 8 twentieths once both are cut into pieces of the same size. That is the whole reason the formula multiplies crosswise: ad restates the first fraction over the shared denominator, cb restates the second, and bd is the size of the new common piece. Multiplication and division skip the resizing entirely. To multiply, work straight across numerators and denominators, and to divide, multiply by the reciprocal of the second fraction, so 3/4 ÷ 2/5 = 3/4 × 5/2 = 15/8.
| Operation | Rule | With the defaults |
|---|---|---|
| Add | (ad + cb) / bd | 23/20 |
| Subtract | (ad − cb) / bd | 7/20 |
| Multiply | ac / bd | 6/20 = 3/10 |
| Divide | ad / bc | 15/8 |
Where the notation comes from
The word fraction descends from the Latin frangere, to break in pieces — a fraction names a broken or partial quantity. The idea is far older than the Latin word. The most detailed surviving record of ancient fraction arithmetic is the Rhind Mathematical Papyrus, copied around 1550 BC, in year 33 of the Hyksos king Apophis, by an Egyptian scribe named Ahmes, from a lost original that dated to the reign of Amenemhat III roughly three centuries earlier. The Scottish antiquarian Alexander Henry Rhind bought the papyrus at Luxor in 1858, and the British Museum acquired it in 1865, two years after his death.
The Egyptian system worked almost entirely with unit fractions — fractions with a numerator of one — written by placing above a numeral the hieroglyph read as mouth, or part, which turned that numeral into its reciprocal. Anything more involved was expressed as a sum of distinct unit fractions, with dedicated symbols reserved only for 1/2, 2/3 and 3/4. A scribe would therefore record 2/5 not as a single symbol but as 1/3 + 1/15, and the papyrus opens with a reference table giving exactly these expansions for 2/n across the fifty odd denominators from 3 to 101. Babylonian scribes took a different route, writing fractions in base sixty, a place-value scheme whose legacy still splits an hour into sixty minutes, a minute into sixty seconds, and a degree into sixty minutes of arc. Astronomers stayed with those sexagesimal fractions long after other trades had dropped them, and that is why ordinary fractions came to be called vulgar, or common, fractions — the label exists to set them apart from the fractions of the sky.
The stacked layout used today traces to Indian mathematicians, who wrote numerator above denominator with no line between them; the arrangement runs through the Bakhshali manuscript and the work of Brahmagupta around 628 and Bhaskara around 1150. The horizontal bar is first attested in the twelfth century with the Moroccan mathematician Abu Bakr al-Hassar, and the same notation reappears in Fibonacci's Liber Abaci of 1202, the book that carried Hindu-Arabic numerals and the fraction bar into Europe. The diagonal slash, convenient for setting a fraction on a single line of type, is a much later printer's shortcut.
Reducing with the Euclidean algorithm
A raw result such as 6/20 is correct but not in lowest terms. To reduce it, the calculator divides both numerator and denominator by their greatest common divisor, found with one of the oldest algorithms still in routine use. Euclid set it out around 300 BC in Book 7 of the Elements, Propositions 1 and 2, though the underlying idea — repeatedly stripping the smaller quantity out of the larger — is older than the book. It was probably known to Eudoxus of Cnidus around 375 BC, and the Greek name for the procedure, anthyphairesis, or reciprocal subtraction, appears in Aristotle as well as Euclid. The modern form replaces the larger number with its remainder on division by the smaller and repeats until one of them reaches zero. For 6 and 20, dividing 20 by 6 leaves a remainder of 2; then 6 divides evenly by 2, so the greatest common divisor is 2 and 6/20 reduces to 3/10. A result like 16/4 collapses all the way to the whole number 4. The same routine underlies the common denominator: this calculator multiplies the two denominators, does the arithmetic, and then reduces, which always lands on the same final fraction as starting from the least common denominator would.
Signs and limits
If a denominator comes out negative, the sign moves up to the numerator, so the result reads −15/8, never 15/−8. Two limitations are worth knowing. The inputs must be whole numbers, so for a value like 2.5/4 you scale both parts by ten and enter 25/40. And results stay exact only while the intermediate products fit inside a 53-bit integer, the largest range JavaScript represents without rounding; that still covers denominators into the millions with room to spare, well beyond anything a hand calculation would use.
When the decimal repeats
A reduced fraction has a terminating decimal only when the denominator's prime factors are limited to 2 and 5. 23/20 terminates because 20 = 2² × 5, giving exactly 1.15. But 1/3 shows as 0.333333 on screen while the true value is 0.3 recurring — the decimal field rounds at six places, while the fraction field stays exact. This is part of why fractions persist in everyday measurement where decimals dominate elsewhere. US recipes call for 2 1/4 cups and wrenches come in 5/8-inch sizes because repeated halving of an inch or a cup lands on clean fractions, while metric kitchens in the UK, the EU and Australia weigh the same ingredients in grams and millilitres and buy spanners sized in millimetres. When a value needs to be both exact and easy to divide by hand, the fraction it started as is often the clearer form to keep.
Frequently asked questions
How do you add fractions with different denominators?
Rewrite both over a common denominator, then add the numerators. For 3/4 + 2/5 the common denominator is 20, so the sum is 15/20 + 8/20 = 23/20. Any common multiple works; this calculator uses the product of the two denominators and reduces afterward, which lands on the same final answer as using the least common denominator.
How do you divide one fraction by another?
Flip the second fraction and multiply — dividing by 2/5 is the same as multiplying by 5/2. So 3/4 ÷ 2/5 = 3/4 × 5/2 = 15/8, which is 1 7/8 as a mixed number. The one case that fails is dividing by a fraction equal to zero, which the calculator flags as an error.
What is the difference between an improper fraction and a mixed number?
An improper fraction has a numerator at least as large as its denominator, like 23/20, while a mixed number splits out the whole part: 1 3/20. Both name the same quantity. Schoolwork usually asks for mixed numbers, while algebra is easier with improper fractions, so the calculator shows both whenever the result is improper.
Why does 1/3 show as 0.333333 instead of the exact value?
Because 1/3 has no finite decimal form — it repeats as 0.3 recurring forever, and the decimal field rounds at six places. A reduced fraction terminates only when its denominator contains no prime factors other than 2 and 5. The fraction output is always the exact answer, so use that one when precision matters.
Can a fraction calculator handle negative fractions?
Yes. Put a minus sign on either the numerator or the denominator and the result carries the correct sign, always shown on the numerator. For example −3/4 ÷ 2/5 gives −15/8, displayed as the mixed number −1 7/8.