Fraction Calculator

Add, subtract, multiply or divide two fractions or mixed numbers and read every step, plus an optional decimal to fraction conversion, in your browser.

🌐 Español

🔒 Private by design: everything is generated locally in your browser and never uploaded to any server.

Two rational numbers, and the four things done to them

Everything on this page is exact rational arithmetic. Each side of the calculation is turned into a single improper fraction first, the operation runs on integer numerators and denominators, and only at the very end is a decimal produced for convenience. No floating point creeps into the answer itself, which is why 1/2 plus 1/3 comes back as 5/6 rather than as 0.8333333333333334.

Addition and subtraction need a shared denominator, found as the least common multiple of the two inputs. Multiplication runs straight across. Division flips the second fraction and multiplies. The report walks through whichever of those routes applies, then reduces the outcome by its greatest common divisor. That divisor comes from the Euclidean algorithm already written and tested for the Aspect Ratio Calculator, imported here rather than written a second time, which is a small thing that removes an entire class of copy-paste bug.

Filling the seven number boxes, and what an emptied one becomes

  1. Type the first fraction into First fraction, whole number part (0 for a plain fraction), First fraction, numerator and First fraction, denominator.
  2. Pick one of Add (+), Subtract (−), Multiply (×) or Divide (÷) under Operation.
  3. Type the second fraction into Second fraction, whole number part (0 for a plain fraction), Second fraction, numerator and Second fraction, denominator.
  4. Optionally type a value into Optional: also convert a decimal to a fraction (leave at 0 to skip), which runs as an entirely separate conversion.
  5. Press the action button, labelled with the page’s own name, Fraction Calculator.

Two behaviours are worth knowing before you trust an odd-looking answer. An emptied number box is read as zero, so clearing a denominator does not restore the value it started with, it produces a denominator of 1, and your fraction quietly becomes a whole number. And fractional entries are rounded to integers first, so typing 2.6 into a denominator gives you a denominator of 3.

Multiply and divide skip straight from step 2 to step 4

Run the defaults, 1/2 plus 1/3, and the working reads as steps 1, 2, 3 and 4: convert to improper fractions, find that 2 and 3 share the least common multiple 6, add 3/6 and 2/6 to make 5/6, and confirm 5/6 is already in simplest form.

Now switch to multiplication with 3/4 and 2/3. Step 1 converts, step 2 multiplies across to give 6/12, and the next line printed is step 4, simplifying 6/12 to 1/2 by dividing both parts by 6. There is no step 3. The simplification line is hard-coded with the number 4 because addition and subtraction always fill that slot, and multiply and divide do not. The arithmetic is complete and correct; only the numbering has a hole in it. Division behaves the same way: 5/8 divided by 1/4 prints a step 2 showing the reciprocal, then jumps to step 4 to reduce 20/8 to 5/2, and finishes with the answer as the mixed number 2 1/2 alongside the improper form and a decimal of 2.5.

One display detail in the division line surprises people. The reciprocal of 1/4 is 4/1, and a fraction with a denominator of 1 is printed as a bare integer, so the line literally reads that 5/8 is multiplied by 4. That is correct, just terser than a textbook would write it.

The decimal box that refuses to guess 1/3

The last field is a second, independent calculator that converts a finite decimal to the exact fraction those digits represent. It reconstructs the fraction from the digit count rather than by multiplying by powers of ten, which is what keeps a value like 0.1 from picking up binary rounding noise on the way in.

The honest consequence is that 0.375 comes back as 3/8, while 0.333 comes back as 333/1000. Three digits cannot tell anyone whether you meant a decimal that stops or a decimal that repeats, and the tool prints a note saying exactly that instead of quietly deciding you meant a third. If you genuinely want a third, enter it as a fraction in the main fields. If the question is really about percentages rather than fractions, the Percentage Calculator covers X% of Y, what percent one number is of another, and the change between two values.

Negative results, and the minus zero that never appears

Because both numerator fields floor at zero and both denominator fields floor at one, the only route to a negative answer is subtraction. Ask for 1/2 minus 3/4 and the report returns -1/4 with a decimal of -0.25.

That is less trivial than it looks. Converting a negative proper fraction back to a mixed number by truncating the division produces the JavaScript value negative zero for the whole-number part, and turning negative zero into text gives you a plain “0”, silently deleting the minus sign from the displayed answer. This module works on the absolute value and tracks the sign as a separate flag, so a negative proper fraction keeps its sign all the way to the screen. Mixed numbers such as 2 3/4 minus 1 5/6 come out as 11/12 with the same machinery, no special case required.

When the whole report collapses to a single line

Division by a fraction that evaluates to zero is the one input that collapses the report. Leave the second whole-number box at 0, set its numerator to 0 as well, choose divide, and instead of a NaN or an Infinity you get the report heading followed by one sentence saying it cannot divide by zero because the second fraction is 0. The fraction lines and the entire step-by-step block are dropped along with it, because the error replaces the report rather than being appended to it.

For anything that needs more than rational arithmetic, logarithms, exponents or trigonometry, the Scientific Calculator is the tool to reach for, and the calculators guide sets out which of the everyday maths tools here answers which kind of question.

See it in action

Screenshot of the Fraction Calculator tool with First fraction, whole number part (0 for a plain fraction) set to 0, First fraction, numerator set to 1
Fraction Calculator mid-process: First fraction, whole number part (0 for a plain fraction) set to 0, First fraction, numerator set to 1.
Screenshot of the Fraction Calculator result screen showing the generated output “=== FRACTION CALCULATOR === Fraction A: 1/2 Frac…”
The finished result: the generated output “=== FRACTION CALCULATOR === Fraction A: 1/2 Frac…”. The download link is a local blob URL — the file never leaves your device.

Frequently asked questions

Which boxes do I use for a mixed number like 2 3/4?

Put 2 in "First fraction, whole number part (0 for a plain fraction)", 3 in "First fraction, numerator" and 4 in "First fraction, denominator". The report converts that to 11/4 before any arithmetic happens and prints the conversion on its own line so you can check it. Leave the whole-number box at 0 for a plain fraction.

Why does the working jump from step 2 to step 4 when I multiply?

The simplification line is written as step 4 in the shared tail of the report, and only addition and subtraction produce a step 3, which is where the numerators get combined over a common denominator. Multiplication and division finish their arithmetic at step 2, so the number 3 is simply never printed. It is a numbering quirk in the labels, not a missing calculation.

Can I enter a negative numerator or denominator?

Not directly. Both numerator boxes floor at zero and both denominator boxes floor at one, so subtraction is the only operation that can produce a negative answer. Ask for 1/2 minus 3/4 and you get -1/4 with a decimal line of -0.25, with the sign carried on the numerator rather than on the whole-number part.

What does the decimal box do with 0.375 compared with 0.333?

0.375 becomes 3/8, because 375/1000 reduces exactly. 0.333 becomes 333/1000 and stays there. The converter reads the digits you typed and nothing else, so it cannot tell a terminating 0.333 from the opening of a repeating 0.3333 and it prints a note saying so instead of guessing at your intent.

How precise is the decimal line under the answer?

Six decimal places, rounded, with trailing zeros stripped. An exact 5/6 therefore prints as 0.833333, which is a rounded reading of a value that never terminates, so treat the fraction as the authoritative answer. Results that do terminate print cleanly, for example 5/2 as 2.5.

What happens if the second fraction works out to zero and I divide?

The report stops and prints a single sentence saying it cannot divide by zero, naming the second fraction as the culprit. Everything else disappears with it, including the two fraction lines and the whole step-by-step block, so a result that is just a heading and one sentence means the second fraction evaluated to zero rather than that the page failed to run.

Related tools