Modulo Calculator
Find the remainder after dividing one number by another
About this calculator
The modulo operation (a mod b) gives the remainder when a is divided by b. 17 mod 5 = 2, because 17 = 3×5 + 2. Modulo is fundamental in programming (checking even/odd: n mod 2), cryptography, scheduling (day of the week calculations), and number theory. The result is always between 0 and b−1.
How to use
17 mod 5: 17 ÷ 5 = 3 remainder 2. Result: 2. To check if a number is even: n mod 2 = 0 means even, n mod 2 = 1 means odd.
Frequently asked questions
What is the difference between remainder and modulo for negative numbers?
In mathematics, modulo is always non-negative. In some programming languages, the % operator returns a negative result for negative inputs. For example, −7 mod 3 = 2 mathematically, but in some languages −7 % 3 = −1.
How is modulo used in real life?
Clock arithmetic uses modulo 12. Day-of-week calculations use modulo 7. ISBN and credit card validation use modulo 10 and 11. Cryptographic systems like RSA are built on modular arithmetic.