Modular inverse

Find a⁻¹ mod m — the number x where ax ≡ 1 (mod m). Essential for RSA and modular arithmetic.

a =mod

What is a modular inverse?

a⁻¹ mod m is the number x where ax ≡ 1 (mod m). It exists only when GCD(a, m) = 1 (a and m are coprime).

3⁻¹ mod 7: 3×5 = 15 ≡ 1 (mod 7) → 3⁻¹ ≡ 5 (mod 7).

Finding it

Use the extended Euclidean algorithm to find x in ax + my = 1, then x mod m is the inverse.

Applications

RSA encryption, solving linear congruences, Chinese Remainder Theorem.

Popular exponent problems
Related calculators