Fraction Calculator

Add, subtract, multiply or divide two fractions, with the result automatically simplified — instantly, in your browser.

Fraction A
Fraction B

Result

5/6

Decimal: 0.833333

  • Free — No signup required
  • Instant — Results update as you type
  • Private — Processed in your browser

Fractions are exact in a way decimals are not. One third is 1/3; as a decimal it is 0.333… truncated somewhere, and the truncation is where the errors come from. The calculator above adds, subtracts, multiplies and divides two fractions and always returns the result in lowest terms, alongside its decimal value for comparison.

How it works

Enter a numerator and denominator for fraction A, pick an operation, and do the same for fraction B. All four fields must be whole numbers — a decimal in a numerator is rejected rather than silently rounded, because 1.5/2 is an ambiguous way of writing 3/4 and guessing would be worse than asking.

The arithmetic is the schoolbook cross-multiplication:

  • Add / subtract — a/b ± c/d = (ad ± cb) / bd
  • Multiply — a/b × c/d = ac / bd
  • Divide — a/b ÷ c/d = ad / bc

The raw result is then simplified by dividing both parts by their greatest common divisor, found with Euclid's algorithm. Two normalisations keep the output tidy: a negative sign is always moved to the numerator, so you get -1/2 rather than 1/-2, and a zero result is reported as 0/1 rather than the -0 that floating-point arithmetic would otherwise produce for 1/2 + 1/-2.

Two inputs are refused outright: a zero denominator in either fraction, and dividing by a fraction whose numerator is zero. Both are genuinely undefined, so the tool says so instead of returning Infinity.

Why exact arithmetic matters

The decimal shown next to the result is a convenience, not the answer. 1/3 + 1/3 + 1/3 is exactly 1 as fractions; add 0.3333 three times and you get 0.9999. Repeat that inside a loop and the drift compounds.

This is the same problem that makes 0.1 + 0.2 === 0.3 false in every language using IEEE 754 doubles, including JavaScript, Java and Python. Binary floating point can represent halves, quarters and eighths exactly, but not tenths — so any denominator with a factor of 5 is approximate from the moment you type it.

The practical response is to not store such values as floats at all. Relational databases distinguish DECIMAL/NUMERIC, which store digits exactly, from FLOAT/DOUBLE, which store an approximation; picking the second for a monetary or measured column is a defect that surfaces months later as totals that are a cent out. SQL best practices covers choosing numeric types and the comparison pitfalls that follow, and database design and normalization sets out how those column choices fit into a schema you can still trust after a few years of change.

Practical notes

Improper fractions stay improper. 3/2 is returned as 3/2, not 1 1/2. Mixed numbers are a display convention, and converting back and forth is where sign errors creep in. To enter a mixed number, convert it yourself first: 2 3/4 is 11/4.

Whole numbers are fractions. Enter 5/1 to combine an integer with a fraction — useful for "how much of the batch is left after removing 5 units".

Large inputs. Cross-multiplication multiplies denominators, so chaining several operations by hand can grow the numbers quickly. The result is always simplified afterwards, but if your denominators are already in the millions, simplify each step before feeding it back in.

For the closely related question of reducing 8:12 to 2:3, or scaling a recipe, the ratio calculator uses the same greatest-common-divisor reduction with a colon instead of a slash.

FAQ

How do I add or subtract fractions with different denominators?
Find a common denominator by multiplying the two denominators together, adjust each numerator to match, then add or subtract.
How do I divide fractions?
Multiply the first fraction by the reciprocal (flipped version) of the second.
Is my data uploaded anywhere?
No. The calculation happens entirely in your browser.