Modulo Calculator
Calculate the remainder when dividing two numbers. Also shows the integer quotient with our free online modulo calculator.
How to Use This Calculator
- Enter the dividend (the number being divided) in the first field.
- Enter the divisor (the number dividing by) in the second field. The divisor must be greater than zero.
- Click Calculate to see the remainder and integer quotient.
- The verification line confirms the result using the formula a = n × q + r.
Formula
Here q is the integer quotient and r is the remainder. The modulo operation finds what remains after integer division.
Examples
Clock Arithmetic
If it is 17:00 now, what time will it be in 9 hours? (17 + 9) mod 12 = 26 mod 12 = 2 → 2:00 AM.
Distributing Items
23 cookies shared among 4 people: 23 mod 4 = 3 leftover cookies (each person gets 5).
Even/Odd Check
A number is even if n mod 2 = 0, odd if n mod 2 = 1. This is the most common use of modulo in programming.
Frequently Asked Questions
What is the modulo operation?
Modulo finds the remainder after integer division. For example, 17 mod 5 = 2 because 17 = 5 × 3 + 2.
How is modulo different from division?
Regular division gives the full result (including the decimal), while modulo gives only the remainder portion.
Can the divisor be zero or negative?
No. Division by zero is undefined. A negative divisor is mathematically valid but may produce different results depending on the convention used.
Where is modulo used in programming?
Modulo is widely used for cyclic operations (arrays, clocks), hash functions, random number generation, and checking divisibility.