Modulo Calculator
Calculate the remainder: a mod n
What Is Modulo?
The modulo operation finds the remainder after division. "a mod n" asks: when you divide a by n, what's left over? Example: 17 mod 5 = 2, because 17 = 5×3 + 2.
Enter the dividend (a)
This is the number being divided. Can be positive, negative, or decimal.
Enter the divisor (n)
This is the number you're dividing by. Cannot be zero.
Calculate the remainder
The result is always between 0 and the divisor (exclusive).
Modulo arithmetic is sometimes called "clock arithmetic." On a 12-hour clock, 15:00 is the same as 3:00 because 15 mod 12 = 3. The pattern repeats every 12 hours.
| Expression | Calculation | Result |
|---|---|---|
| 17 mod 5 | 17 = 5×3 + 2 | 2 |
| 20 mod 4 | 20 = 4×5 + 0 | 0 |
| 7 mod 3 | 7 = 3×2 + 1 | 1 |
| 100 mod 7 | 100 = 7×14 + 2 | 2 |
Cryptography
RSA encryption and many cryptographic algorithms rely on modular arithmetic with large prime numbers.
Computer Science
Hash functions, circular buffers, and determining even/odd (n mod 2) all use modulo operations.
Time Calculations
Converting between 24-hour and 12-hour time, calculating day of week, handling wraparound.
Checksums
ISBN check digits, credit card validation (Luhn algorithm), and error detection use modulo.
Frequently Asked Questions
Other Free Tools
Division Calculator
Division Calculator
Addition Calculator
Addition Calculator
Multiplication Calculator
Multiplication Calculator
Subtraction Calculator
Subtraction Calculator – Subtract Numbers Instantly
Expression Evaluator
Expression Evaluator
Percentage Calculator
Percentage Calculator – Calculate Percentages Instantly