Modular Arithmetic Calculator

Work out a mod m, modular sums, products, powers and inverses, always reduced into the range from 0 to m − 1.

Modular arithmetic

Result: —
Enter a and b plus the modulus m. Answers are always normalised into the range 0 to m − 1.

How to use the Modular Arithmetic Calculator

  1. Choose the operation: modulo, sum, product, power or inverse.
  2. Enter the value a, the value b and the modulus m.
  3. Read the answer, which is always reduced into the range 0 to m − 1.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online modular arithmetic calculator.

Modular arithmetic works with the remainder after division. For example 17 mod 5 is 2, because 17 divided by 5 leaves a remainder of 2.
Divide the first number by the modulus and keep the remainder. The calculator shows that remainder in the range from zero up to m minus one.
Yes. Choose the power operation and the tool uses fast modular exponentiation, so values like 2 to the power 10 mod 1000 are found quickly.
The modular inverse of a is the value that multiplies with a to give 1 mod m. It exists only when a and m share no common factor.
An inverse exists only when the number and the modulus are coprime. When they share a common factor, no such inverse can exist.
Yes. Negative values are accepted, and the answer is always normalised into the standard range from zero up to m minus one.
It appears in cryptography, check digits, hashing, clock arithmetic and programming tasks such as keeping an index inside an array.
No. All arithmetic runs locally in your browser, so the numbers you type never leave your device.
Yes. It is completely free and unlimited, with no account, no sign-up and no usage caps of any kind.

Last updated: October 10, 2026