Modulo Calculator
Remainder of division.
Input
Result
What is a Modulo Calculator?
A Modulo Calculator computes the remainder when one number is divided by another. It answers the question "What is left over?" after division and is widely used in mathematics and programming.
How to calculate modulo manually (the formula)
To find a mod b, divide a by b, discard the fractional part to get the integer quotient, multiply the quotient by b, and subtract from a. The result is the remainder.
Example calculation
Calculate 17 mod 5. 17 ÷ 5 = 3.4, so the integer quotient is 3. 3 × 5 = 15. 17 − 15 = 2. Therefore, 17 mod 5 = 2.
Common mistakes
- Confusing modulo with division — Modulo returns the remainder, not the quotient.
- Forgetting that divisor can be larger than dividend — When a < b, a mod b = a because b goes into a zero times.
- Assuming the result is always the last digit — This works only for mod 10. For other divisors, the remainder depends on the full division.
Frequently asked questions
What is modulo?
Modulo gives the remainder after dividing one number by another.
How do I calculate modulo manually?
Divide the dividend by the divisor, then multiply the quotient (rounded down) by the divisor and subtract from the dividend.
What is 10 mod 3?
10 mod 3 = 1 because 10 ÷ 3 = 3 remainder 1.
What is modulo used for in programming?
Modulo is used for checking even/odd numbers, cycling through arrays, and time calculations.
Can modulo be negative?
In mathematics, modulo is usually positive; in programming, the result can be negative depending on the language.