Skip to content
ToolInstant

Modulo Calculator

Local

Compute a mod n the maths way and the programming way (the % remainder) for numbers of any size, plus modular exponentiation a^b mod n and modular inverses.

Loading tool…

Ready · Runs in this browser · nothing uploaded

Utility tools · Free · No upload · No sign-up

How to use the modulo calculator for free

  1. 1Enter a and n — negatives and very large numbers are fine.
  2. 2Compare the mathematical mod, the % remainder and the Euclidean result.
  3. 3Use the lower panel for a^b mod n.

Also useful for: modulo calculator, mod calculator, remainder calculator, modular exponentiation, negative modulo, modular inverse.

  • Completely free, no account needed
  • Your data never leaves your device
  • Works on desktop and mobile

Frequently asked questions

Is this modulo calculator free?+

Yes. Every tool on ToolInstant is free to use with no sign-up and no limits on how often you use it.

Is my data uploaded anywhere?+

No. Everything is processed inside your browser using JavaScript. Your input never leaves your device.

Does it work on mobile?+

Yes. ToolInstant works in any modern browser on phones, tablets and desktops.

Why is −17 mod 5 equal to 3 here but −2 in JavaScript?+

Maths (and Python, Excel MOD) uses floored division, so the result takes the sign of the divisor: −17 = 5 × (−4) + 3. JavaScript, Java and C use truncated division, giving −17 = 5 × (−3) − 2. Both are shown.