Modulo Calculator

Your details

Choose the modular arithmetic operation to perform.
The number being divided, or the base for power mod.
Used in addition, subtraction, multiplication, power mod, and congruence modes.
The modulus (divisor). Must be a non-zero integer.
Compare the mathematical result with the C/Python/JavaScript % result.
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