Calculate the remainder of division, also known as modulo or mod. Enter two numbers and see the remainder, quotient, and the equation breakdown.
Modulo calculator
Using the calculator
Enter a Dividend (the number being divided) and a Divisor (the number you're dividing by). The calculator updates in real-time.
You'll see:
- Remainder (Modulo) - the main result, what's left after division
- Quotient - how many times the divisor fits into the dividend (integer part)
- Exact division - the full decimal result
- Equation breakdown - shows the relationship: dividend = divisor × quotient + remainder
What is modulo?
Modulo (or "mod") gives you the remainder after division. When you divide 17 by 5:
- 5 goes into 17 three times (5 × 3 = 15)
- That leaves 2 remaining (17 - 15 = 2)
- So 17 mod 5 = 2
Written mathematically:
Or using the programming notation:
The division equation
Every division can be expressed as:
The modulo operation extracts just the remainder part.
Common uses
Checking divisibility - if a mod b = 0, then a is divisible by b. For example, 15 mod 5 = 0, so 15 is divisible by 5.
Even/odd check - if n mod 2 = 0, n is even. If n mod 2 = 1, n is odd.
Clock arithmetic - 14:00 in 12-hour format is 14 mod 12 = 2 (2 PM).
Cryptography - modular arithmetic is fundamental to encryption algorithms like RSA.
Programming - cycling through arrays, distributing items, hash functions.
Negative numbers
This calculator uses floored division, which keeps the remainder the same sign as the divisor. For -17 mod 5, you get 3 (not -2). This matches the mathematical convention and languages like Python.
Some programming languages (C, Java, JavaScript's %) use truncated division instead, which can give negative remainders. If you're debugging code, be aware of which convention your language uses.
