Remainder Calculator


This online Remainder Calculator performs Euclidean division of two integer numbers, the dividend and the divisor, to find the quotient and remainder. The input numbers, both dividend and divisor, can be positive or negative integers.


Dividend (x):
Divisor (y):

Quotient (q):
Remainder (r):


Division With Remainder

The Euclidean division (or division with remainder, or long division with remainder) is the process of dividing one integer (the dividend) by another (the divisor), in a way that produces a quotient and a remainder smaller than the divisor.

Euclid’s division lemma says that given two positive integers \(x\) and \(y\), there exist unique integers \(q\) and \(r\) such that

$$x = y \cdot q + r, \kern 0.5em 0 \leq r \lt y.$$

The integer \(q\) is the quotient and the integer \(r\) is the remainder. The quotient and the remainder are unique.

The idea behind all this is to find the greatest integer less than or equal to \(x\) that is divisible by \(y\) without remainder (or with remainder equal to \(0\)). The integers divisible by \(y\) are all in the form \(y \cdot q\) for an arbitrary integer \(q\). And we call the \(q\) which satisfies this requirement the quotient. Then the remainder \(r\) is \(x – y \cdot q\).

Let’s consider a simple example of division: \(37 \div 5\). The greatest integer less than \(37\) which can be divided by \(5\) with no remainder is \(35 = 7 \cdot 5\). So, \(7\) will be here the quotient, and \(2 = 37 – 35\) will be the remainder:

$$q = 35 \div 5 = 7$$ $$r = 37 – 35 = 2.$$

Notice that because \(r = x – y \cdot q\), the requirement that \(y\cdot q\) is the greatest integer less than \(x\) ensures that \(r\) will always be either \(0\) (when \(x\) divides evenly into \(y\)) or a positive integer less than the absolute value of \(y\): \( 0 \leq r \lt |y| \).

Division With Negative Numbers

• Negative dividend

Let’s modify the example above by making \(x\) negative: \((-37) \div 5\). We’re dividing a negative by a positive number, so we know the quotient will be negative. Therefore, this time we’re looking for the negative multiples of \(5\). And here \(-40\) is the largest integer divisible by \(5\) less than the dividend \(-37\). Which means that the quotient and remainder are:

$$q = (-40) \div 5 = (-8)$$ $$r = (-37) – (-40) = 3.$$

• Negative divisor

Another modification of the above example where the divisor is negative: \(37 \div (-5)\). Again, because we’re dividing positive by negative, we know the quotient will be negative. But because the divisor is also negative (and the dividend is positive), we’re looking for the positive multiples of \(-5\). The result of this division is:

$$q = 35 \div (-5) = (-7)$$ $$r = 37 – 35 = 2.$$

• Negative dividend and divisor

When the remainder is \(0\), the result doesn’t change when we simultaneously switch the signs of the dividend and the divisor. This is not the case when both dividend and divisor are negative. To see what happens then, let’s consider the final modification to our example: \((-37) \div (-5)\). We’re dividing negative by negative, so the quotient will be positive. This means that we’re looking for the negative multiply of \((-5)\) that is less then the dividend. The result of this division will be:

$$q = (-40) \div (-5) = 8$$ $$r = (-37) – (-40) = 3.$$

As we can see, the division with remainder can be confusing in some cases. So the easiest way to perform such a division is to use our quotient and remainder calculator.


Related calculators

Check out our other math calculators such as Greatest Common Divisor Calculator or Modulo Calculator.