Long Division Calculator
Divide two integers and see the quotient and remainder in the form used by classical long division. Handles the case where the dividend is not a clean multiple of the divisor.
Last updated: September 2026
Compare with similar
About this calculator
Long division breaks a division problem into two parts: the quotient, which is how many whole times the divisor fits into the dividend, and the remainder, which is what is left over. For integers, dividend = quotient × divisor + remainder, and 0 ≤ remainder < |divisor|.
This calculator returns the pair 'q remainder r' rather than a single decimal, because that is the form grade-school long division produces and is what many exam questions expect. If you want the decimal form instead, divide directly: 17 ÷ 5 = 3.4, which is the same 3 remainder 2 written differently (2/5 = 0.4).
Division by zero is undefined and the calculator flags it explicitly rather than returning ∞ or NaN, because a silent non-result usually hides a data-entry bug.
How to use
Example 1 — divide 17 by 5. Enter Dividend = 17, Divisor = 5. Result: '3 remainder 2'. Verify: 3 × 5 = 15, and 17 − 15 = 2. The remainder is less than the divisor (2 < 5), as it must be. Example 2 — divide 100 by 7. Enter 100 and 7. Result: '14 remainder 2'. Verify: 14 × 7 = 98, and 100 − 98 = 2. As a decimal, 100 ÷ 7 = 14.285714… — the repeating 285714 comes from the fact that 2/7 is a recurring decimal, and the 2 is exactly the remainder this calculator returns.
Frequently asked questions
What if the divisor is larger than the dividend?
The quotient is 0 and the remainder is the dividend itself. Example: 3 ÷ 10 = '0 remainder 3', because 10 fits into 3 zero times with 3 left over. This is correct; some paper long-division layouts skip writing the leading 0 but the math is identical.
How do I use this for polynomial long division?
This calculator handles integer division only. Polynomial long division follows the same idea — divide the leading term, subtract, bring down, repeat — but on symbolic expressions rather than digits. For polynomial work, use a symbolic algebra system; for integer work, this calculator is enough.
How does the remainder relate to modulo (%)?
The remainder is exactly the result of the modulo operator for positive integers: 17 % 5 = 2, matching this calculator. For negative dividends, languages differ (some return a negative remainder, others follow the mathematical convention 0 ≤ r < |divisor|). This calculator uses Math.trunc for the quotient, so negative dividends give a remainder with the same sign as the dividend.
What is the largest number I can divide?
JavaScript integers are exact up to 2^53 − 1 (about 9 quadrillion). Beyond that, floating-point rounding can shift the quotient by 1 and give a wrong remainder. Stay under 10^15 and the answer is exact.