Fraction calculator

Add, subtract, multiply or divide fractions, mixed numbers and decimals. Get the simplified fraction, mixed number and decimal with the steps.

How it works

  1. Type two numbers, such as 1 1/2 and 3/4
  2. Pick +, −, × or ÷
  3. Read the simplified fraction and the steps

What you can type

Each box takes one number of up to 60 characters. A fraction is written 3/4, with or without spaces around the slash. A mixed number is a whole part, a space and a fraction, as in 1 1/2; the fraction part may be larger than 1, so 1 5/2 is read as 3 1/2. A minus in front applies to the whole number: -1 1/2 means minus one and a half. A whole number (-2, 7) or a decimal (0.25, .5, 3.) is also fine, and a leading + is allowed. Not accepted: a minus in the denominator (write -1/2, not 1/-2), a decimal inside a fraction (2.5/4), thousands commas and spoken forms. A denominator of zero shows a message under the box and no result.

How the answer is built

For addition and subtraction the page finds the least common denominator, the lcm of the two denominators, converts both fractions to it and combines the numerators: 3/2 + 3/4 uses lcm(2, 4) = 4, so 6/4 + 3/4 = 9/4. Multiplication multiplies numerators and denominators. Division flips the second fraction and multiplies, and dividing by zero (in any spelling, such as 0, 0/5 or 0.00) shows Cannot divide by zero under the second box. The result is then reduced by the greatest common divisor, and the box called How this was worked out shows each of these lines with your numbers, including gcd(4, 6) = 2 style simplification.

Mixed number and decimal

The same answer is shown three ways: as a simplified fraction, as a mixed number (9/4 is 2 1/4, an improper negative such as -7/6 is -1 1/6, and a proper fraction stays as it is), and as a decimal to 10 decimal places. When the decimal does not end sooner, as with 1/3 or 1/7, it is rounded half up at the 10th place and the tile says Rounded to 10 decimal places; when it ends exactly, the tile says Exact.

Exact arithmetic and its limit

All the integer arithmetic uses BigInt, so numerators and denominators can be as long as the 60 characters allow without losing a digit. In a browser without BigInt the page falls back to ordinary whole numbers that are exact up to 9,007,199,254,740,991; if a step would go past that, it shows a message that the numbers are too large instead of a wrong digit. Nothing you type is stored or sent anywhere.

Frequently asked questions

How do I add 1 1/2 and 3/4?

Write 1 1/2 as 3/2. The denominators 2 and 4 have lcm 4, so 3/2 becomes 6/4. Then 6/4 + 3/4 = 9/4, which is already in lowest terms and equals the mixed number 2 1/4 or the decimal 2.25.

How does the calculator simplify a fraction?

It divides the numerator and denominator by their greatest common divisor. For 4/6 the gcd is 2, giving 2/3. When the gcd is 1, as for 9/4, the steps box says the fraction is already in lowest terms.

How do I divide by a fraction?

Flip the second fraction and multiply. 1/2 ÷ 3/4 becomes 1/2 × 4/3 = 4/6, which simplifies to 2/3. Dividing by zero, in any spelling such as 0, 0/5 or 0.00, gives the message Cannot divide by zero.

Can I type a decimal or a negative number?

Yes. 0.25 is read as 25/100 and reduced to 1/4. A leading minus works on fractions, mixed numbers and decimals: -1 1/2 is minus three halves. Put the minus in front of the whole number, not in the denominator.

Why does the decimal say it is rounded?

Fractions such as 1/3 and 1/7 have decimals that never end. The tile shows 10 decimal places, rounded half up, so 2/3 appears as 0.6666666667 and 1/3 as 0.3333333333. The fraction above it is the exact answer.

What is the biggest number it can handle?

Each box takes up to 60 characters, and BigInt keeps every digit. Only a browser without BigInt is limited, to whole numbers up to 9,007,199,254,740,991; there you get a message instead of a rounded result.