How to use Modular Arithmetic Calculator
- Choose Remainder, Power or Inverse, then enter integer a and an integer modulus greater than 1. Negative a is allowed.
- For Power, enter a whole exponent from 0 to 1,000,000. The exponent field is ignored by the other operations.
- Calculate and read the result from 0 to m − 1. For an inverse, the output also checks that a × result mod m = 1; shared factors produce an explanation instead.
Example: Modular Arithmetic Calculator
Find a Euclidean remainder.
Supported inputs and limits
- Value a and modulus m accept signed integer text with up to 1,000 digits, without commas, decimal points or exponent notation.
- The modulus must exceed 1.
- Power accepts only whole exponents from 0 to 1,000,000; negative powers are unsupported.
- The result uses exact BigInt arithmetic within these bounds.
- An inverse exists only when a and m are coprime.
More details
This is not a cryptographic key generator or a constant-time implementation.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
An inverse undoes multiplication modulo the chosen modulus
An inverse b satisfies a × b congruent to 1 modulo m. It is a property of the integer together with its modulus, so changing the modulus can change the result or remove the inverse.
Questions about Modular Arithmetic Calculator
What happens to a negative integer?
The Euclidean remainder stays between zero and modulus minus one. For example, -1 modulo 5 is 4.
Why can an inverse be unavailable?
An integer has a multiplicative inverse modulo m only when its greatest common divisor with m is one.
Does exponent zero give one?
Yes, reduced modulo the accepted modulus. The tool uses the standard modular exponentiation convention.