Modulo Calculator — Calculate a mod b

Calculate the modulo (remainder) of any division. Enter dividend and divisor to find the remainder, quotient, and full equation a = bq + r.

a mod b
mod
Examples:
Remainder (r)
Quotient (q)
Full Equation
a is Even/Odd (mod 2)

Step-by-Step

Modular Arithmetic Applications

Even/Odd testn mod 2: 0 = even, 1 = odd
Clock timehours mod 12 (12-hour format)
Day of weekdays mod 7 (0=Sun,...,6=Sat)
Circular indexi mod n (wraps 0 to n-1)

Frequently Asked Questions

What is modulo (mod)?
The modulo operation (%) finds the remainder after dividing one number by another. For example, 17 mod 5 = 2 because 17 = 3×5 + 2. The remainder is always 0 ≤ r < divisor for positive numbers.
What is the difference between modulo and remainder?
For positive numbers they are the same. For negative numbers they differ: -7 mod 3 = 2 (modulo, always non-negative) but -7 % 3 = -1 (remainder in most programming languages). This calculator uses the mathematical modulo definition.
Where is modulo used?
Modulo is everywhere in programming and mathematics: checking if a number is even/odd (n mod 2), wrapping values in circular ranges (clock arithmetic), cryptography (RSA uses modular exponentiation), hash functions, and digital checksums.
What is clock arithmetic?
Clock arithmetic (modular arithmetic) works like a clock: after 12, you go back to 1. "15 o'clock" = 15 mod 12 = 3. This is used in cryptography, calendar calculations, and computer science.
Can modulo be applied to decimals?
Yes. For example, 5.5 mod 2 = 1.5. The formula still holds: 5.5 = 2×2 + 1.5. This calculator handles decimal inputs for both dividend and divisor.