Division with remainder calculator

Enter an integer dividend and a nonzero divisor to calculate the quotient and the unique Euclidean remainder.

Dividend a
Divisor b

Quotient and remainder

7, remainder 2

Check: 37 = 5 × 7 + 2Read explanation below

How the remainder calculator works

Thirty-seven counters arranged as seven equal groups with two left over

Enter an integer dividend and a nonzero integer divisor. The calculator returns the whole-number quotient and the only non-negative remainder smaller than the absolute value of the divisor.

The rule behind the answer

Euclidean division rewrites the dividend as a multiple of the divisor plus a leftover part. The pair is valid only when both the equality and the remainder range hold.

a=bq+r,0r<ba=bq+r,\qquad 0\le r<\lvert b\rvert

Here a is the dividend, b the divisor, q the integer quotient and r the remainder. The check printed with an ordinary result substitutes all four values into the equality.

Three ways to read a remainder

37 divided by 5 gives 7 remainder 2. Seven full groups use 35 items, leaving two: 37 = 5 × 7 + 2.

20 divided by 4 gives 5 remainder 0. A zero remainder says that 4 divides 20 exactly.

1,439 divided by 4 gives 359 remainder 3. Four lots of 359 account for 1,436, and the last three restore the dividend.

−17 divided by 5 gives −4 remainder 3. The quotient moves down to the next integer so that the remainder stays non-negative.

Input limits and negative numbers

Some programming languages define the % operator by truncating toward zero. For example, JavaScript reports −17 % 5 as −2. This calculator normalizes the result to the Euclidean remainder 3, so always check which convention a programming task expects.

Questions about division with a remainder

The equality is a quick check, while the range condition settles the less obvious cases involving zero and negative values.

How do I check the result?

Multiply the divisor by the quotient and add the remainder. The total must equal the dividend, and the remainder must satisfy 0 ≤ r < |b|.

Can the remainder equal the divisor?

No. If the remainder reaches the absolute value of the divisor, one more whole group can be moved into the quotient.

What does remainder zero mean?

It means the dividend is exactly divisible by the divisor. For example, 20 = 4 × 5 + 0.

Can I divide zero?

Yes. Zero divided by any nonzero integer has quotient 0 and remainder 0.

Why is division by zero rejected?

There is no remainder range below |0|, and multiplying zero by a quotient cannot determine a unique division result.

Why can a negative dividend have a positive remainder?

The quotient is chosen so that the remainder lies from 0 through |b| − 1. Thus −17 = 5 × (−4) + 3.

Similar calculators

You may find the following calculators on the same topic useful:

Share on social media

If you liked it, please share the calculator on your social media platforms. It`s easy for you and beneficial for the project`s promotion. Thank you!