Fraction Calculator

Add, subtract, multiply, or divide two fractions and reduce the result.

Use this tool

Result

The result appears in this panel after you run the tool.

About this tool

Each fraction is reduced by the greatest common divisor, and the sign is kept on the numerator. Addition uses a common denominator. Multiplication and division use the cross products.

The result is an exact fraction, not a rounded decimal.

How to use it

  1. Enter the numerator and denominator of each fraction.
  2. Choose add, subtract, multiply, or divide.
  3. Calculate. The result is reduced with bigint arithmetic.

Limitations

Integer fractions, reduced by their gcd

Four whole-number boxes

Each fraction is a numerator and a denominator, both whole numbers, stored as integers rather than binary floats. The operation is add, subtract, multiply, or divide. Before any operation, each fraction is reduced by the greatest common divisor of its two parts, and a negative denominator flips the sign onto the numerator. The printed form is a single integer when the reduced denominator is 1, and otherwise numerator/denominator.

One half plus one third

Enter 1 over 2, plus, 1 over 3. The common denominator is 6. The sum of the scaled numerators is 3 + 2, so the unreduced sum is 5/6, which is already reduced. The panel prints 5/6. A second check: 2 over 4 is reduced to 1/2 as soon as it is read, so 2/4 plus 1/4 is the same addition as 1/2 plus 1/4, and the panel prints 3/4. Subtraction adds the negation of the right-hand numerator. Multiplication multiplies straight across. Division multiplies by the reciprocal.

Zeros and decimals

A denominator of zero is refused while the fraction is being built, before the operation runs. Dividing by a fraction whose numerator is zero is also refused. Decimal points are refused, because these boxes want whole numbers, not floating measurements. A very large integer is still exact, because the arithmetic stays in arbitrary-precision integers rather than IEEE doubles. The page does not print a mixed number such as 1 1/2. An improper result stays improper, and a whole result drops the denominator. There is no “keep unreduced” switch. The gcd step always runs.

Multiplication as a second check

Two thirds times three quarters reduces across: numerators 2 × 3 and denominators 3 × 4 become 6/12, and the gcd of 6 and 12 is 6, so the panel shows 1/2. Division of those same fractions multiplies 2/3 by 4/3 and prints 8/9. A leading plus on an integer is accepted by the whole-number parser. A trailing slash with an empty denominator is not a legal integer and is refused before any gcd runs. Results can be negative, with the minus sitting on the numerator, as in 1/2 minus 3/4, which prints -1/4.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.