Inverse Modulo Calculator
Find a modular multiplicative inverse with the extended Euclidean algorithm and verify the congruence.
About modular multiplicative inverses
Modular inverse examples
An inverse exists in each successful example because the integer and modulus are coprime.
| Integer and modulus | Inverse | Verification |
|---|---|---|
| 3 modulo 11 | 4 | 3 times 4 leaves remainder 1 modulo 11. |
| 5 modulo 12 | 5 | 5 times 5 leaves remainder 1 modulo 12. |
| 17 modulo 43 | 38 | 17 times 38 leaves remainder 1 modulo 43. |
| 10 modulo 17 | 12 | 10 times 12 leaves remainder 1 modulo 17. |
How to find an inverse modulo m
- Enter the integer whose modular inverse you need.
- Enter an integer modulus greater than one.
- Choose Find Modular Inverse to run the extended Euclidean algorithm.
- Confirm the result with the displayed multiplication congruence.
Inverse modulo calculator FAQ
When does a modular inverse exist?
An inverse exists exactly when the integer and modulus have greatest common divisor 1. Such a pair is described as coprime.
Can zero have a modular inverse?
No, zero multiplied by any integer remains congruent to zero. It cannot produce a remainder of 1 for a modulus greater than one.
Why is the result nonnegative?
Every inverse has infinitely many equivalent integer representatives separated by multiples of the modulus. The calculator reports the least nonnegative representative for consistency.
How does the extended Euclidean algorithm find the inverse?
It expresses the greatest common divisor as an integer combination of the input and modulus. When the divisor is 1, the coefficient of the input is an inverse after modular normalization.
How do I check a modular inverse?
Multiply the integer by the proposed inverse and divide by the modulus. The remainder must equal 1 for the inverse to be valid.