Active experiment

Modulo and Remainder Calculator

Find the Euclidean quotient and nonnegative remainder.

Step 01 · Set up

Fill in the mathematics

Replace the highlighted values below. Tab moves naturally through the equation.

Step 03 · Answer

Ready when you are

Substitution & process

Enter the known values, then select Calculate. Your working steps will appear here.

Understand the method

What does the modulo and remainder calculation mean?

Modulo returns the remainder after integer division, chosen to be nonnegative. Every integer a can be written as a = bq + r with 0 ≤ r < b, which fixes r uniquely even when a is negative.

When to use it

Use it for repeating cycles such as clock times, calendar weekdays, check digits, and hash buckets.

Formula

a=bq+r,0≤r<b

In plain text: a = bq + r, 0 ≤ r < b

Variables and units

SymbolMeaning
athe dividend
bthe divisor, nonzero
qthe quotient
rthe remainder, with 0 ≤ r < b

How to use the calculator

  1. Enter each known value in its labeled field.
  2. Select the answer precision you want.
  3. Choose Calculate answer to see the result and working.

Worked example

−17 mod 5 equals 3 because −17 = 5(−4) + 3. The quotient rounds toward negative infinity so the remainder stays nonnegative, unlike some programming languages.

Common mistakes

  • A negative dividend still yields a nonnegative remainder here.
  • The divisor cannot be zero.
  • Modulo is not the same as the fractional part of a division.

Interpret the result

Two integers with the same remainder are congruent modulo b, meaning their difference is a whole multiple of b.