Modulo Calculator
What's Left Over
Modulo returns the remainder after division rather than the quotient — the part that arithmetic normally throws away. It's the operation behind clock arithmetic (13:00 becomes 1:00 PM using mod 12), even/odd tests, and the wraparound logic in countless programs. This calculator follows the mathematical convention where the result always takes the sign of the divisor, matching the behavior programmers expect from languages like Python.
The Formula
This floor-based definition means the sign of the result matches the sign of the divisor (b), which differs from some languages' built-in % operator that instead matches the sign of the dividend (a).
Where Modulo Is Used
- Programming — cycling through array indices, detecting even/odd numbers, and hashing all rely on modulo.
- Cryptography — modular arithmetic is the mathematical foundation of RSA and other public-key encryption schemes.
- Scheduling — recurring events (every 7 days, every 12 hours) are naturally expressed with a modulus.
- Unit conversion — splitting a total (like seconds) into larger units and a remainder (minutes and leftover seconds).
| a | b | a mod b |
|---|---|---|
| 7 | 3 | 1 |
| −7 | 3 | 2 |
| 7 | −3 | −2 |
Notice that −7 mod 3 gives a positive result (2), since the result's sign always follows the divisor, not the dividend.
How to Use This Calculator
- Enter the Number (a) — the value being divided.
- Enter the Divisor (b) — cannot be zero.
- Select Calculate to see the remainder.
Related Calculations
Need the full division result rather than just the remainder? The Basic Calculator covers standard division, and the Scientific Calculator adds roots, powers, and logarithms.