How to Calculate Fractions

Fraction Calculator

Fraction 1
+ − × ÷
Fraction 2

Result

=

Understanding Fraction Calculations

Calculating fractions is a fundamental skill in mathematics that involves combining parts of a whole. Whether you are adding, subtracting, multiplying, or dividing, each operation follows a specific set of logic rules.

How to Add and Subtract Fractions

To add or subtract fractions, you must first ensure they have a Common Denominator. If the denominators are different, you must find the Least Common Multiple (LCM) of the denominators and adjust the numerators accordingly.

  • Step 1: Find a common denominator.
  • Step 2: Add or subtract the numerators.
  • Step 3: Keep the denominator the same.
  • Step 4: Simplify the resulting fraction if possible.

How to Multiply Fractions

Multiplication is the simplest fraction operation. You do not need a common denominator.

Formula: (a / b) × (c / d) = (a × c) / (b × d)

Simply multiply the top numbers (numerators) together and the bottom numbers (denominators) together, then simplify the result.

How to Divide Fractions

To divide fractions, use the "Keep, Change, Flip" method:

  • Keep the first fraction as it is.
  • Change the division sign to multiplication.
  • Flip the second fraction (find its reciprocal).
  • Multiply as usual.

Practical Examples

Example 1 (Addition): 1/4 + 1/2. Convert 1/2 to 2/4. Result: 1/4 + 2/4 = 3/4.

Example 2 (Multiplication): 2/3 × 4/5. Result: (2×4) / (3×5) = 8/15.

function calculateFractions() { var n1 = parseInt(document.getElementById('num1').value); var d1 = parseInt(document.getElementById('den1').value); var n2 = parseInt(document.getElementById('num2').value); var d2 = parseInt(document.getElementById('den2').value); var op = document.getElementById('operation').value; if (isNaN(n1) || isNaN(d1) || isNaN(n2) || isNaN(d2)) { alert("Please enter valid numbers in all fields."); return; } if (d1 === 0 || d2 === 0) { alert("Denominator cannot be zero."); return; } var resultNum, resultDen; if (op === "add") { resultNum = (n1 * d2) + (n2 * d1); resultDen = d1 * d2; } else if (op === "subtract") { resultNum = (n1 * d2) – (n2 * d1); resultDen = d1 * d2; } else if (op === "multiply") { resultNum = n1 * n2; resultDen = d1 * d2; } else if (op === "divide") { if (n2 === 0) { alert("Cannot divide by zero."); return; } resultNum = n1 * d2; resultDen = d1 * n2; } // Simplify function var commonDivisor = function gcd(a, b) { return b ? gcd(b, a % b) : a; }; var common = Math.abs(commonDivisor(resultNum, resultDen)); var finalNum = resultNum / common; var finalDen = resultDen / common; // Handle negative signs if (finalDen Math.abs(finalDen) && finalDen !== 1) { var whole = Math.floor(Math.abs(finalNum) / finalDen); var rem = Math.abs(finalNum) % finalDen; var sign = finalNum < 0 ? "-" : ""; mixedDisplay.innerText = "Mixed Number: " + sign + whole + " " + rem + "/" + finalDen; } else if (finalDen === 1) { mixedDisplay.innerText = "Whole Number Result"; document.getElementById('resDen').style.display = "none"; document.getElementById('simplified-display').querySelector('div').style.display = "none"; } else { mixedDisplay.innerText = "Proper Fraction"; document.getElementById('resDen').style.display = "block"; document.getElementById('simplified-display').querySelector('div').style.display = "block"; } }

Leave a Comment