Remainder Calculator (Quotient and Modulo)

Enter a dividend and a divisor to get the quotient and the remainder, with the negative-number conventions explained.

Remainder Calculator

Your result will appear hereFill in the fields and press “Calculate”.

Formula

  • dividend = divisor × quotient + remainder
  • 0 ≤ remainder < |divisor| (Euclidean convention)
  • The remainder is what is left after taking out as many whole copies of the divisor as possible

Dividing 17 by 5 leaves 3 whole fives and 2 left over.

Worked examples

17 ÷ 5

Dividend (the number being divided)
17
Divisor
5

Quotient and remainder

17 ÷ 5 = 3 remainder 2

As a decimal: 3.4

Remainder (never negative): 2 (quotient 3)

Remainder with the divisor's sign (floor modulo): 2 (quotient 3)

−7 ÷ 3

Dividend (the number being divided)
−7
Divisor
3

Quotient and remainder

−7 ÷ 3 = −2 remainder −1

As a decimal: −2.3333333333

Remainder (never negative): 2 (quotient −3)

Remainder with the divisor's sign (floor modulo): 2 (quotient −3)

How it works

Division with remainder splits a whole number into whole groups plus what is left: 17 ÷ 5 gives a quotient of 3 and a remainder of 2, because 17 = 5 × 3 + 2. The calculator uses exact integer arithmetic, so large numbers are handled without rounding.

Negative numbers are where conventions differ. Most programming languages (C, Java, JavaScript) give a remainder with the sign of the dividend, so −7 % 3 is −1; Python and mathematics textbooks usually give a result with the sign of the divisor or a never-negative remainder. The tool shows the truncated result and the other two common conventions side by side so you can pick the one your context uses.

For divisibility without a full division see the Divisibility Checker, and for the greatest common divisor of two numbers the HCF and LCM Calculator. Fractions and mixed numbers are covered by the Fraction Calculator.

Assumptions and limits

  • Whole numbers only; the divisor cannot be zero.
  • Three conventions are shown for negative numbers: truncated, never-negative and floor modulo.