Find remainders, test divisibility, and explore modular arithmetic. Enter a dividend and divisor to see the quotient, remainder, and whether it divides evenly.
Enter two numbers to divide and see the remainder.

How to Use the Modulo Calculator
The modulo operation finds the remainder after division. It answers questions like "if I split 17 cookies among 5 people, how many are left over?" This calculator shows the remainder, the full division breakdown, and whether the divisor fits evenly.
- Enter the dividend. This is the number being divided, such as 17 in 17 mod 5.
- Enter the divisor. This is the number you divide by. It cannot be zero.
- Read the result. You get the remainder, the equation (dividend = divisor x quotient + remainder), and a plain-English note about divisibility.
- Try negatives. Enter a negative dividend to see how remainders stay non-negative in standard math convention.
Modulo Explained
Modulo, written as "mod" or "%", returns what is left after whole division. For 17 mod 5: 5 fits into 17 three times (3 x 5 = 15), leaving 17 - 15 = 2. So 17 mod 5 = 2. The general relationship is: a = b x q + r, where q is the whole quotient and r is the remainder, always satisfying 0 <= r < |b|.
Modular arithmetic powers huge parts of modern life. Clocks are mod 12 (13 o'clock is 1 PM). Calendars use mod 7 for weekdays. Computer science leans on it constantly: even/odd checks are n mod 2, hash tables place items with key mod table-size, and cryptography like RSA is built on modular exponentiation. Game developers use modulo to wrap positions around screen edges.
Worked Example
Compute 23 mod 4. Ask how many whole 4s fit in 23: 4 x 5 = 20, and 4 x 6 = 24 is too big, so the quotient is 5. Subtract: 23 - 20 = 3. The remainder is 3, so 23 mod 4 = 3. Check with the formula: 23 = 4 x 5 + 3. Correct. Because the remainder is not zero, 4 does not divide 23 evenly.
Modulo Reference Table
Common results worth recognizing on sight — check any of them in the calculator above:
| Expression | Division | Quotient | Remainder (mod) |
|---|---|---|---|
| 10 mod 3 | 10 ÷ 3 | 3 | 1 |
| 15 mod 4 | 15 ÷ 4 | 3 | 3 |
| 20 mod 5 | 20 ÷ 5 | 4 | 0 |
| 17 mod 7 | 17 ÷ 7 | 2 | 3 |
| 100 mod 12 | 100 ÷ 12 | 8 | 4 |
| 255 mod 16 | 255 ÷ 16 | 15 | 15 |
| 7 mod 2 | 7 ÷ 2 | 3 | 1 |
| 8 mod 2 | 8 ÷ 2 | 4 | 0 |
Where Modulo Shows Up in Real Life
Parity and divisibility. Any number mod 2 is 0 when even and 1 when odd, and a remainder of 0 against any divisor proves divisibility — the fastest test in number theory, and the first step in finding greatest common divisors.
Days of the week. Weekdays repeat every 7, so weekday questions are mod 7 questions. What day is it 100 days after a Monday? 100 mod 7 = 2, so count two days forward: Wednesday.
Check digits. The last digit of an ISBN-10 is chosen so a weighted sum of all ten digits is divisible by 11. Take 0-306-40615-2: multiply the digits by 10 down to 1 and add — 0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 + 2 = 132 — and 132 mod 11 = 0, so the code is valid. One mistyped digit breaks the sum, which is how scanners and software catch errors. Barcodes and credit cards use the same idea with different moduli.
Wrap-around in code. Cycling through a list, placing items in a hash table, and generating repeating patterns all use index mod length — the same wrap-around that turns 25 o'clock back into 1 AM.
Negative Numbers: The Two Conventions
Negative dividends are where "mod" and the % key on a programming keyboard part ways. Mathematics uses floored division, which keeps the remainder non-negative: −17 mod 5 = 3, because −17 = 5 × (−4) + 3. Many programming languages instead truncate toward zero and return −2 for the same expression. This calculator follows the math convention, as its results show — if you are cross-checking code output, that difference is the first thing to look for when answers disagree.
Frequently Asked Questions
What does "mod" mean in math?
Mod gives the remainder after division. 17 mod 5 = 2 because 5 goes into 17 three times (15), leaving 2 left over.
What is the difference between mod and remainder?
In everyday use they are the same. Technically, some programming languages return negative remainders for negative dividends, while math convention keeps the result non-negative. This calculator follows the math convention.
How is modulo used in programming?
To check even/odd (n % 2), cycle through arrays (index % length), wrap values, generate repeating patterns, and implement hash functions and checksums.
Why does division by zero fail?
Dividing by zero has no defined answer — no number of zeros adds up to a non-zero dividend. The calculator blocks it and asks for a valid divisor.
What is clock arithmetic?
Clock math is arithmetic mod 12 (or 24). 10 + 5 = 3 on a 12-hour clock because 15 mod 12 = 3. It is the most familiar everyday example of modular arithmetic.
Related Calculators
Need remainders in fraction form? Try the Scientific Calculator for division and powers. For the number theory built on remainders, try the GCD Calculator and the LCM Calculator.
