Modulo Calculator
Your details
Operation
i
Choose the modular arithmetic operation to perform.
Basic: a mod n
Modular addition: (a + b) mod n
Modular subtraction: (a - b) mod n
Modular multiplication: (a × b) mod n
Power mod: a^b mod n
Congruence check: a ≡ b (mod n)?
Dividend / First number (a)
i
The number being divided, or the base for power mod.
Second number / Exponent (b)
i
Used in addition, subtraction, multiplication, power mod, and congruence modes.
Modulus (n)
i
The modulus (divisor). Must be a non-zero integer.
Show language comparison
i
Compare the mathematical result with the C/Python/JavaScript % result.
Reset
Result (mod n)
Has a remainder
2
Quotient (floored)
3
GCD(a, n)
1
▸
17 mod 5 = 2.
17 is 2 more than the nearest multiple of 5 (that multiple is 15).
The mathematical modulo is always non-negative: it lies between 0 and |n| - 1 regardless of the sign of a or n.
=
Powered by
OnlyCalculators