Modulo Calculator
Calculate the remainder when one number is divided by another.
This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.
Can't find what you need?
Request a ToolHow to Use the Modulo Calculator
Enter a dividend and a divisor, and the remainder appears instantly. The breakdown shows the full division relationship.
- Enter the dividend (a). This is the number being divided.
- Enter the divisor (b). This is what you divide by. Cannot be zero.
- Read the result. The remainder is shown along with the quotient and the equation a = quotient x b + remainder.
About the Modulo Operation
The modulo operation finds the remainder after dividing one integer by another. For example, 17 mod 5 = 2, because 17 = 3 x 5 + 2. Modulo is widely used in programming, cryptography, clock arithmetic, and number theory.
In programming, the modulo operator is usually written as % (e.g., 17 % 5 returns 2). A common use is checking if a number is even: n % 2 equals 0 for even numbers and 1 for odd numbers.
Frequently Asked Questions
What does modulo mean?
Modulo (abbreviated "mod") gives the remainder after division. 17 mod 5 = 2 because 17 divided by 5 is 3 with a remainder of 2.
What happens when you mod by zero?
Division by zero is undefined, so modulo by zero is also undefined. The calculator will display an error if you enter 0 as the divisor.
How is modulo used in programming?
Programmers use modulo to check divisibility (n % 2 == 0 for even numbers), cycle through arrays, implement hash functions, and wrap values around ranges like clock arithmetic.