Modulo Calculator
Calculate the remainder (modulo) of a division. Enter the dividend and divisor to get the remainder. Useful for programming, clock arithmetic, and determining if a number is even or odd.
Modulo calculator
Remainder
What is this?
Modulo (mod) returns the remainder after division. For example, 17 mod 5 = 2 because 17 ÷ 5 = 3 remainder 2. In programming, often written as % (e.g., 17 % 5 = 2). The result is always less than the divisor and has the same sign as the dividend in most programming languages. Modulo is used extensively in computer science for wrapping values, distributing items, and cryptography. The calculator handles positive integers; behavior with negative numbers can vary by language.
When to use
Use for checking even/odd (n mod 2), clock arithmetic (hours wrap at 12), cycling through items, or hashing. Example: Is 42 even? 42 mod 2 = 0, yes. 14:00 + 5 hours = 19 mod 12 = 7 (7pm). Programmers use it for array indexing and loops. Game developers use it for wrapping screen coordinates. Cryptographers use it in modular arithmetic. Students learn it in discrete math. Essential for many algorithms.
How to use
Enter dividend and divisor. Modulo (remainder) = dividend − (divisor × floor(dividend ÷ divisor)).
Frequently asked questions
- Modulo (mod) is the remainder after division. For example, 17 mod 5 = 2 because 17 ÷ 5 = 3 remainder 2.
- Use modulo 2. If n mod 2 = 0, the number is even. If n mod 2 = 1, it is odd.