Divide two fractions and get the simplified result instantly.
÷
=
Result will appear here
Step-by-Step Solution:
How to Divide Fractions
Dividing fractions might seem complex, but it follows a very simple rule known as the "Keep, Change, Flip" method. To divide one fraction by another, you simply multiply the first fraction by the reciprocal (the inverted version) of the second fraction.
The "Keep, Change, Flip" Rule:
Keep the first fraction exactly as it is.
Change the division symbol (÷) to a multiplication symbol (×).
Flip the second fraction (find its reciprocal by swapping the numerator and denominator).
Our fraction division calculator automatically simplifies your answer to its lowest terms. It does this by finding the Greatest Common Divisor (GCD) of the resulting numerator and denominator and dividing both by that number. If the result is an improper fraction (where the top number is larger than the bottom), it can also be expressed as a mixed number.
Frequently Asked Questions
What happens if the denominator is zero? Division by zero is undefined in mathematics. Ensure your denominators are non-zero integers.
Can I divide negative fractions? Yes! The same rules apply. If one fraction is negative, the result is negative. If both are negative, the result is positive.
How do I divide a whole number by a fraction? Treat the whole number as a fraction with a denominator of 1 (e.g., 5 becomes 5/1).
function gcd(a, b) {
return b ? gcd(b, a % b) : a;
}
function calculateFractionDivision() {
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 resultArea = document.getElementById('result-area');
var stepsBox = document.getElementById('steps-box');
var solutionSteps = document.getElementById('solution-steps');
if (isNaN(n1) || isNaN(d1) || isNaN(n2) || isNaN(d2)) {
resultArea.innerHTML = 'Please enter valid numbers.';
stepsBox.style.display = 'none';
return;
}
if (d1 === 0 || d2 === 0 || n2 === 0) {
resultArea.innerHTML = 'Cannot divide by zero.';
stepsBox.style.display = 'none';
return;
}
// Calculation: (n1/d1) / (n2/d2) = (n1*d2) / (d1*n2)
var finalNum = n1 * d2;
var finalDen = d1 * n2;
// Simplify
var commonDivisor = Math.abs(gcd(finalNum, finalDen));
var simplifiedNum = finalNum / commonDivisor;
var simplifiedDen = finalDen / commonDivisor;
// Handle negative signs for display
if (simplifiedDen < 0) {
simplifiedNum = -simplifiedNum;
simplifiedDen = -simplifiedDen;
}
// Format result
var resultHTML = '';
if (simplifiedDen === 1) {
resultHTML = '
' + simplifiedNum + '
';
} else {
resultHTML = '
' +
'
' + simplifiedNum + '
' +
'' +
'
' + simplifiedDen + '
' +
'
';
// Add mixed number if improper
if (Math.abs(simplifiedNum) > Math.abs(simplifiedDen)) {
var whole = Math.floor(Math.abs(simplifiedNum) / Math.abs(simplifiedDen));
var rem = Math.abs(simplifiedNum) % Math.abs(simplifiedDen);
var sign = simplifiedNum < 0 ? '-' : '';
resultHTML += '