A modular inverse is the modular arithmetic version of division. When a and m are coprime, extended Euclid gives a Bezout coefficient for a, and that coefficient reduced modulo m is the inverse.
⚠The modulus must be at least 2. If gcd(a, m) is not 1, modular division by a is not valid under that modulus.
What Is a Modular Inverse?
A modular inverse of a modulo m is a number x that makes a x leave remainder 1 when divided by m. It is essential for solving modular equations and for many cryptography calculations.
Inverse Condition
The inverse exists exactly when gcd(a, m) = 1.
Extended Euclid
Bezout coefficients provide the inverse directly.
Normalization
Negative coefficients are converted to the range 0 to m-1.
Verification
The final check multiplies a by the inverse modulo m.
Example: For a = 17 and m = 43, extended Euclid finds 17 x 38 ≡ 1 mod 43, so the modular inverse is 38.
Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.