Quotient and Remainder Calculator

Enter a dividend and divisor to find the quotient, remainder, mod operation, and step-by-step long division.

Examples:

What are Quotient and Remainder?

When we divide one whole number by another, we get two components: the quotient and the remainder. The quotient is the number of whole times the divisor fits into the dividend. The remainder is what is left over after those complete fits have been subtracted out.

For example, dividing 17 by 5: 5 goes into 17 three full times (3 × 5 = 15), leaving 17 − 15 = 2 left over. So the quotient is 3 and the remainder is 2. The remainder is always at least 0 and always less than the divisor.

The Division Algorithm: a = q·b + r

The Division Algorithm is a formal guarantee: for any integers a (dividend) and b (divisor) with b ≠ 0, there exist unique integers q (quotient) and r (remainder) such that:

a = q × b + r, where 0 ≤ r < |b|

The uniqueness is critical: there is exactly one valid pair (q, r) for each (a, b). This theorem is fundamental in number theory and algebra — it is the basis for the Euclidean algorithm for computing GCD, modular arithmetic, and polynomial long division.

Long Division Step-by-Step

Long division works digit by digit from left to right:

  1. Bring down the first digit (or the first group of digits that is at least as large as the divisor).
  2. Determine how many times the divisor fits into that group — this is the first digit of the quotient.
  3. Multiply that quotient digit by the divisor and subtract from the group.
  4. Bring down the next digit and repeat steps 2–3.
  5. When no digits remain, the last remainder is the final remainder.

What is Modulo?

The modulo operation (written a mod b or a % b) returns only the remainder when a is divided by b. For positive integers, modulo and remainder are identical. For example, 17 mod 5 = 2, 100 mod 7 = 2, 360 mod 360 = 0.

Modulo is everywhere in computing: it wraps array indices cyclically, converts between time zones, generates hash values, and drives the Caesar cipher. The expression (n mod m) always produces a result in the range [0, m−1], making it perfect for producing bounded cyclic values.

Negative Numbers in Division

Negative numbers create a choice of convention. Truncation division (used by most programming languages like C, Java, JavaScript) rounds the quotient toward zero: −17 ÷ 5 gives quotient −3, remainder −2 (since −3 × 5 + (−2) = −17). Floor division (used in Python, and matching the mathematical definition of modulo) rounds the quotient toward −∞: −17 ÷ 5 gives quotient −4, remainder 3 (since −4 × 5 + 3 = −17).

This calculator uses floor division (the true mathematical modulo) for negative dividends, which ensures the remainder is always non-negative. Both conventions satisfy a = q × b + r; they just choose different q and r pairs.

Real-World Uses

Clock arithmetic is modular arithmetic mod 12 (or 24): 3 hours after 11:00 is (11 + 3) mod 12 = 2:00. Day-of-week calculations use mod 7. Even/odd testing is just checking n mod 2. In computer science, hash tables use mod to map arbitrary integers to array indices; circular buffers use mod to wrap around; checksums and error-detecting codes are built on modular arithmetic. Dividing items equally — say, 100 cookies among 7 children — gives each child 14 (quotient) with 2 left over (remainder).

Frequently Asked Questions

The quotient is the whole-number result of dividing one number by another. When 17 ÷ 5, the quotient is 3 because 5 fits into 17 exactly 3 whole times (3 × 5 = 15 ≤ 17 < 4 × 5 = 20).
The remainder is the amount left over after the divisor has been subtracted from the dividend as many whole times as possible. For 17 ÷ 5, the remainder is 17 − 3×5 = 2. It always satisfies 0 ≤ r < divisor.
q = floor(a / b). r = a − q × b. Verify: q × b + r = a. Example: 100 ÷ 7 → q = floor(14.28...) = 14, r = 100 − 98 = 2.
For integers a and b (b ≠ 0), there exist unique integers q and r with a = q×b + r and 0 ≤ r < |b|. This theorem guarantees every division has exactly one quotient and remainder pair.
For positive numbers they are the same. The difference is in how negatives are handled. Truncation remainder has the same sign as the dividend; floor modulo is always non-negative when the divisor is positive. −7 ÷ 3: truncation gives r = −1; floor gives r = 2.
No. The remainder always satisfies 0 ≤ r < |b|. If r were ≥ b, we could subtract b one more time and increase the quotient by 1, contradicting the uniqueness of (q, r).
Clock arithmetic, day-of-week calculations, distributing items equally, computer hash tables, circular buffers, ISBN/credit card check digits, and calendar calculations all rely on quotient and remainder (modular arithmetic).

Related Calculators