Fraction Calculator Mixed Fractions

Mixed Fraction Calculator

Add, Subtract, Multiply, and Divide Mixed Fractions


+ – × ÷

Result:

How to Use the Mixed Fraction Calculator

This Mixed Fraction Calculator is designed to help you perform arithmetic operations on fractions that include a whole number and a proper fraction. Whether you are working on school math or measuring ingredients for a recipe, this tool provides quick, simplified answers.

Understanding Mixed Fractions

A mixed fraction (or mixed number) consists of three parts:

  • Whole Number: The integer portion (e.g., the 2 in 2 1/2).
  • Numerator: The top number of the fraction part.
  • Denominator: The bottom number of the fraction part.

Manual Calculation Steps

If you prefer to solve mixed fractions by hand, follow these steps:

  1. Convert to Improper Fractions: Multiply the whole number by the denominator, add the numerator, and place the result over the original denominator.
  2. Perform the Operation:
    • Addition/Subtraction: Find a common denominator before adding or subtracting the numerators.
    • Multiplication: Multiply numerators together and denominators together.
    • Division: Invert the second fraction (reciprocal) and then multiply.
  3. Simplify: Reduce the resulting fraction to its lowest terms.
  4. Convert Back: If the result is improper (numerator > denominator), convert it back into a mixed fraction.

Example: Adding 1 1/2 and 2 3/4

  1. Convert 1 1/2 to 3/2.
  2. Convert 2 3/4 to 11/4.
  3. Find a common denominator: 3/2 becomes 6/4.
  4. Add: 6/4 + 11/4 = 17/4.
  5. Convert to mixed fraction: 17 ÷ 4 = 4 with a remainder of 1. Result: 4 1/4.
function getGCD(a, b) { a = Math.abs(a); b = Math.abs(b); while (b) { var t = b; b = a % b; a = t; } return a; } function calculateFraction() { var w1 = parseInt(document.getElementById('whole1').value) || 0; var n1 = parseInt(document.getElementById('num1').value) || 0; var d1 = parseInt(document.getElementById('den1').value) || 1; var w2 = parseInt(document.getElementById('whole2').value) || 0; var n2 = parseInt(document.getElementById('num2').value) || 0; var d2 = parseInt(document.getElementById('den2').value) || 1; var op = document.getElementById('operator').value; if (d1 === 0 || d2 === 0) { alert("Denominator cannot be zero."); return; } // Convert to improper fractions var impNum1 = (Math.abs(w1) * d1) + n1; if (w1 < 0) impNum1 = -impNum1; var impNum2 = (Math.abs(w2) * d2) + n2; if (w2 < 0) impNum2 = -impNum2; var resNum, resDen; if (op === 'add') { resNum = (impNum1 * d2) + (impNum2 * d1); resDen = d1 * d2; } else if (op === 'subtract') { resNum = (impNum1 * d2) – (impNum2 * d1); resDen = d1 * d2; } else if (op === 'multiply') { resNum = impNum1 * impNum2; resDen = d1 * d2; } else if (op === 'divide') { if (impNum2 === 0) { alert("Cannot divide by zero."); return; } resNum = impNum1 * d2; resDen = d1 * impNum2; } // Standardize sign if (resDen < 0) { resNum = -resNum; resDen = -resDen; } // Simplify var common = getGCD(resNum, resDen); resNum = resNum / common; resDen = resDen / common; // Prepare displays var improperStr = "Improper Fraction: " + resNum + "/" + resDen; var mixedStr = ""; if (resNum === 0) { mixedStr = "0"; } else if (resDen === 1) { mixedStr = resNum.toString(); } else { var wholePart = Math.floor(Math.abs(resNum) / resDen); var remNum = Math.abs(resNum) % resDen; var sign = resNum < 0 ? "-" : ""; if (wholePart === 0) { mixedStr = sign + remNum + "/" + resDen; } else if (remNum === 0) { mixedStr = sign + wholePart; } else { mixedStr = sign + wholePart + " (" + remNum + "/" + resDen + ")"; } } document.getElementById('result-display').innerHTML = mixedStr; document.getElementById('improper-display').innerHTML = improperStr; document.getElementById('result-box').style.display = 'block'; }

Leave a Comment