Education
Remainder Calculator
Enter two whole numbers and the calculator returns the quotient and a non-negative remainder, with the matching division statement and modulo notation.
Whole number to divide. · e.g. 17
Cannot be 0. · e.g. 5
Returns the quotient and a non-negative remainder. Dividend = divisor × quotient + remainder.
Quotient and remainder
3 R 2
17 ÷ 5
The calculator returns a non-negative remainder (Euclidean division), so 0 ≤ remainder < |divisor|. The JavaScript % operator gives a different sign for negative dividends.
Examples
17 ÷ 5
= 3 R 2 · 17 mod 5 = 2
100 ÷ 7
= 14 R 2 · 100 mod 7 = 2
20 ÷ 4
= 5 R 0 · 20 mod 4 = 0
How it works
For whole numbers a and b with b nonzero, there is exactly one pair (q, r) such that a = b · q + r and 0 ≤ r < |b|. That q is the quotient and r is the remainder. This is the Euclidean form of division.
Definition · dividend = divisor · quotient + remainder
Constraint · 0 ≤ remainder < |divisor|
Always returns a non-negative remainder even for negative dividends.
Related math calculators
- Long division calculator for the long-division view of quotient and remainder.
- Factor calculator for factors, factor pairs, and prime factorization.
- GCF calculator for greatest common factor (uses the same Euclidean algorithm).
- LCM calculator for least common multiple, built on top of the GCF.
- All education calculators.
Frequently asked questions
When you divide one whole number by another, the remainder is what is left over after the divisor goes into the dividend as many full times as possible. For 17 ÷ 5, the divisor 5 fits 3 times into 17 (using 15), and the remaining 2 is the remainder. The full relationship is dividend = divisor × quotient + remainder.
Divide the dividend by the absolute value of the divisor and take the floor for the quotient. Multiply that quotient back by the divisor and subtract from the dividend to get the remainder. This calculator uses Euclidean division so the remainder is always non-negative and strictly less than the absolute value of the divisor.
In day-to-day math they are the same: the leftover from division. In programming, % is called the modulo operator and is well defined for both positive and negative inputs, but different languages choose different sign conventions. JavaScript's % keeps the sign of the dividend, while mathematical 'mod' (Euclidean) always returns a non-negative value. This calculator uses the Euclidean convention.
With Euclidean division the remainder is always 0 ≤ r < |divisor|. So -7 mod 3 returns quotient -3 and remainder 2, because -7 = 3 × (-3) + 2. The signed remainder you would see from JavaScript's % operator for -7 % 3 is -1, with quotient -2. Both are valid; this calculator picks the non-negative form because it lines up with how math is normally taught.
Division by 0 is undefined. The calculator flags the input and returns no answer. Make sure the divisor is a nonzero whole number.
Yes. Remainder is defined for integer division. If you enter a decimal, the calculator flags it. For decimal division, use the long-division calculator or a basic calculator instead.
Related calculators
Education
Final Grade Calculator
Calculate your final course grade from your current grade and your final exam score.
Education
Weighted Grade Calculator
Combine assignments, quizzes, and exams by weight to get a precise weighted course average.
Education
Final Exam Calculator
Find out exactly what you need to score on your final exam to hit your target course grade.