Modulo Calculator – Remainder of Division
a mod b returns the remainder: 17 mod 5 = 2, 100 mod 7 = 2, and −7 mod 3 = 2 under the mathematical convention.
- Clock math explained.
Figures are estimates from this calculator’s standard formula — adjust the inputs in the tool below for your exact number.
How the Modulo Calculator Works
The modulo operation reports what remains after taking out whole multiples of the divisor. 17 mod 5 = 2 because 17 = 3×5 + 2; the quotient 3 is discarded and the remainder 2 is the answer. Clock arithmetic is everyday modulo: 22:00 is 10 pm because 22 mod 12 = 10, and adding 7 + 9 hours lands at 16 → 4 o’clock since 16 mod 12 = 4. The calculator handles negative dividends with the mathematical convention, −7 mod 3 = 2 (because −7 = −3×3 + 2), and flags the programming convention (−1) so you can match your language. Evenness testing is the classic filter — n mod 2 = 0 means even, and 100 mod 7 = 2 shows how remainders detect non-divisibility. Congruence notation a ≡ b (mod m) appears too: 17 ≡ 2 (mod 5), the basis of modular arithmetic.
- 1
Enter dividend and divisor
Values like 17 and 5
- 2
Divide and drop the quotient
17 ÷ 5 = 3 remainder 2; only the remainder survives
- 3
Read the remainder
17 mod 5 = 2
- 4
Interpret the congruence
17 ≡ 2 (mod 5) links the result to clock-style arithmetic
Use Cases
Even/Odd Checks
n mod 2 = 0 gates alternating row colors and parity logic
Clock & Calendar
22 mod 12 = 10 pm; weekday cycles use mod 7
Hashing & Cycling
Array index wrap-around: i mod length
Tips
- 1
a mod b ∈ {0, 1, …, b−1} under the math convention
- 2
mod 2 = 0 tests even; mod 3 = 0 tests divisibility by three
- 3
Programming languages may return −1 for −7 mod 3; math says 2
Common Mistakes
Confusing the remainder with the quotient (3 vs 2 for 17 mod 5)
Expecting −7 mod 3 to be negative; mathematical result is +2
Computing 100 mod 7 as 14 — it is 2 (14×7 = 98)
Using modulo with a divisor of 0, which is undefined
FAQs
What is 17 mod 5?
What is −7 mod 3?
How does modulo tell if a number is even?
What is 100 mod 7?
Why is clock arithmetic modulo?
Related tools
Pick another tool to continue your calculation.
Significant Figures Calculator – Sig Figs
Calculate significant figures and round numbers accordingly.
Simpson’s Rule Integration Calculator
Calculate numerical integration using Simpson's rule.
Number Base Change Calculator – With Steps
Convert numbers between different numeral systems.
Taylor Approximation Calculator – Estimate f(x)
Calculate Taylor series approximation at a given point.
Babylonian Square Root Method – Iterations
Calculate square root using Babylonian method.
Bisection Method Calculator – Bracketing Roots
Find equation root using bisection method.