HomeMath › Fraction Calculator

Fraction Calculator

Adds, subtracts, multiplies or divides two fractions, mixed numbers, whole numbers or decimals with exact integer arithmetic, returning the result in lowest terms, as a mixed number and as a decimal, with the intermediate steps.

When to use

You need an exact result of an operation on two fractions (e.g. 3/4 + 1/6), including mixed numbers such as 1 1/2, rather than a rounded decimal.

Do not use when: You only want to reduce a single fraction or convert it to a decimal or percent (use fraction-simplifier), or you need the least common denominator of several denominators (use gcd-lcm).

Formula

a/b + c/d = (a·(L/b) + c·(L/d)) / L with L = lcm(b, d), a/b − c/d likewise; a/b × c/d = (a·c) / (b·d); a/b ÷ c/d = (a·d) / (b·c); the result is divided by gcd(numerator, denominator)

Operands are parsed to exact integer numerators and denominators (a decimal becomes k/10^n) and combined with arbitrary-precision integers, so the fraction outputs are exact for any input size; only the decimal output is rounded.

Inputs

ParameterTypeUnitRequiredDescription
fraction_astringyesFirst operand: a fraction '3/4', a mixed number '1 1/2' or '-1 1/2', a whole number '5' or a decimal '0.75'.
fraction_bstringyesSecond operand in the same formats.
operationenum: add | subtract | multiply | dividedefault addOperation applied as fraction_a (operation) fraction_b.

Outputs

OutputTypeUnitDescription
resultstringExact result in lowest terms with the sign in the numerator, e.g. '11/12' (a whole number when the denominator reduces to 1).
mixed_numberstringResult as whole part plus proper fraction, e.g. '1 1/2'.
numeratorintegerNumerator of the reduced result.
denominatorintegerDenominator of the reduced result (always positive).
decimalnumbernumerator / denominator.
workingstringSteps: operands in lowest terms, the common-denominator or reciprocal step, the unreduced result and the reduced result.

Example

3/4 + 1/6: {"fraction_a":"3/4","fraction_b":"1/6","operation":"add"}{"result":"11/12","mixed_number":"11/12","numerator":11,"denominator":12,"decimal":0.916667,"working":"3/4 + 1/6 = 9/12 + 2/12 = 11/12"}

2 1/3 − 5/6: {"fraction_a":"2 1/3","fraction_b":"5/6","operation":"subtract"}{"result":"3/2","mixed_number":"1 1/2","numerator":3,"denominator":2,"decimal":1.5,"working":"7/3 − 5/6 = 14/6 − 5/6 = 9/6 = 3/2"}

GET https://tttkmbb.com/api/v1/calculate/fraction-arithmetic?fraction_a=3%2F4&fraction_b=1%2F6&operation=add

Machine access

Sources

FAQ

How do I enter a negative mixed number?

Put the sign in front of the whole part: '-1 1/2' means −(1 + 1/2) = −3/2. A sign on the numerator or denominator of a plain fraction ('-3/4' or '3/-4') is also accepted.

Can I enter decimals?

Yes. A decimal such as 0.75 is converted exactly to 75/100 = 3/4 before the operation, so 0.75 + 1/6 gives 11/12.

Why is the working shown with a common denominator?

Addition and subtraction use the least common denominator L = lcm(b, d), e.g. 3/4 + 1/6 = 9/12 + 2/12; multiplication and division do not need one.

Related calculators