All calculators

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.

Remainder

Quotient and remainder

3 R 2

17 ÷ 5

Dividend17
Divisor5
Quotient3
Remainder2
Statement17 = 5 × 3 + 2
Modulo17 mod 5 = 2

The calculator returns a non-negative remainder (Euclidean division), so 0 ≤ remainder < |divisor|. The JavaScript % operator gives a different sign for negative dividends.

Was this helpful?

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

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.