Fraction Calculator

Denominators do not add. That single rule is behind most fraction errors, and it is why 1/2 + 1/3 is 5/6 rather than the 2/5 that pattern-matching suggests. The arithmetic here is done in exact integers, reduced by the greatest common divisor at the end, and shown with the common-denominator step visible so the method is checkable rather than just the answer.

Fraction Calculator — Add, Subtract, Multiply and Divide Fractions in Lowest TermsBuildFigure

The four operations

  • Adding and subtracting requires a common denominator first. Rewrite both fractions over the least common multiple of the two denominators, then add or subtract the numerators and leave the denominator alone. 3/4 + 5/6: the LCM of 4 and 6 is 12, so 3/4 becomes 9/12 and 5/6 becomes 10/12, and the sum is 19/12.
  • Multiplying needs no common denominator. Multiply the tops, multiply the bottoms, reduce. 2/3 x 3/4 = 6/12 = 1/2.
  • Dividing means multiplying by the reciprocal: flip the second fraction and multiply. 2/3 divided by 3/4 = 2/3 x 4/3 = 8/9. Flipping the wrong one is the second most common fraction error after adding denominators.

A mixed number is converted to an improper fraction before anything else happens: 1 2/3 becomes (1 x 3 + 2)/3 = 5/3. Convert first, calculate second. Trying to handle the whole part separately works for addition and falls apart immediately for multiplication.

Reducing, and why it is exact here

A fraction is in lowest terms when the numerator and denominator share no factor beyond 1. To get there, divide both by their greatest common divisor. 19 and 12 are coprime, so 19/12 is already reduced; as a mixed number that is 1 7/12, since 12 goes into 19 once with 7 left over, and as a decimal it is 1.583333…

Every step on this page is done in whole numbers. The numerators and denominators are integers, the common denominator comes from an exact least-common-multiple computation, and the reduction uses the Euclidean algorithm on integers — the same routine behind the GCD and LCM calculator. No intermediate value is ever converted to a decimal and back, which is what makes the reduction exact rather than approximate. The decimal line at the bottom is a display of the exact fraction, not the source of it.

Decimals in, fractions out

A terminating decimal converts by inspection: count the digits after the point, put the digits over that power of ten, and reduce. 0.375 is 375/1000, and dividing both by 125 gives 3/8. This page will accept a decimal anywhere a fraction is expected, so 0.5 + 1/4 works and is handled as 1/2 + 1/4.

Repeating decimals are the exception, and no amount of typed digits fixes it. 0.333 is exactly 333/1000, not 1/3, and any tool that returns 1/3 from those three characters is guessing at your intention. The honest algebra for the repeat is to set x = 0.333…, note that 10x = 3.333…, subtract to get 9x = 3, so x = 1/3. Since this page cannot know whether you meant a truncation or a repeat, the conversion mode reports the exact fraction of what you typed and separately offers the nearest fraction with a denominator under 1000, found by continued fractions. For 0.333 that nearest fraction is 1/3, and it is the line you usually want.

Limits and edge cases

InputWhat happens
7/4Improper fractions are fine, and are reported as 1 3/4 on the mixed line
-1 2/3The sign applies to the whole mixed number, giving -5/3, and results carry the sign on the numerator
0/5Reduces to 0/1 and displays as 0
3/0Rejected. A zero denominator is not a fraction
Division by a zero fractionRejected with a message rather than returning infinity
Values above a trillionRejected, so every integer step stays exact in double-precision arithmetic

That last row is the reason for the cap. Whole numbers are exact in a browser up to about nine quadrillion, and multiplying two denominators near a trillion stays inside that. Push past it and the arithmetic silently loses low-order digits, which would turn a reduction that looks clean into one that is quietly wrong. Refusing the input is better than printing a plausible answer.

If you only wanted the decimal

Converting between fractions of an inch and decimals, in the sixteenths and thirty-seconds a tape measure is actually marked in, is a different job with different rounding rules. The fraction to decimal converter handles that side, including the nearest tick on a given rule. This page is for exact arithmetic on arbitrary fractions, where the point is that nothing gets rounded until the display.

Questions people ask

Why is 1/2 + 1/3 not 2/5?

Because a denominator names the size of the pieces, not a quantity to be added. Halves and thirds are different-sized pieces, so their numerators cannot be combined until both are expressed in pieces of the same size. Rewrite over sixths: 1/2 is 3/6 and 1/3 is 2/6, so the sum is 5/6. A sanity check that catches this instantly: 1/2 is already more than 2/5, so a sum that includes 1/2 plus something positive cannot possibly be 2/5. Adding denominators does have a use, in the mediant and in Farey sequences, but it is not addition.

Which fraction gets flipped in a division?

The second one, the divisor. 2/3 divided by 3/4 is 2/3 times 4/3. The reason is that dividing by a number is the same as multiplying by its reciprocal, and it is the number you are dividing by that gets inverted. If you are unsure in the moment, check against a case you know: 1 divided by 1/2 is 2, because there are two halves in a whole. Flipping the first fraction instead would give 1/2, which is obviously wrong, and that test takes two seconds.

Does the common denominator have to be the least common multiple?

No. Any common multiple works, and multiplying the two denominators together always produces one. Using 4 x 6 = 24 for 3/4 + 5/6 gives 18/24 + 20/24 = 38/24, which reduces to 19/12 — the same answer with more reducing at the end. The least common multiple simply keeps the numbers smallest, which matters when you are doing it by hand and matters not at all to a computer. This page uses the LCM and shows it, because that is what a marker expects to see in the working.

How do I add a fraction to a whole number or a decimal?

Type the whole number or decimal straight into either fraction box. A whole number such as 5 is read as 5/1, and a decimal such as 0.25 is read as 25/100 and reduced to 1/4 before anything is calculated, so mixing forms across the two boxes is fine. What you cannot do is type an expression with more than two terms; this page takes exactly two operands. For a longer chain, work left to right, copying each result into the first box for the next step.

Related