Multiplicative Inverse Modulo Calculator

Enter an integer a and a modulus m to find the modular multiplicative inverse — the value a⁻¹ such that a × a⁻¹ ≡ 1 (mod m). The calculator uses the Extended Euclidean Algorithm to compute the result and tells you whether the inverse exists (it only does when gcd(a, m) = 1).

The integer whose modular inverse you want to find.

The modulus m (must be a positive integer ≥ 2).

Results

Modular Multiplicative Inverse (a⁻¹ mod m)

--

GCD(a, m)

--

Inverse Exists?

--

Verification: (a × a⁻¹) mod m

--

Frequently Asked Questions

What is a modular multiplicative inverse?

The modular multiplicative inverse of an integer a modulo m is an integer b such that a × b ≡ 1 (mod m). In other words, when you multiply a by its modular inverse and divide by m, the remainder is 1. It is often written as a⁻¹ mod m.

When does a modular inverse exist?

The modular multiplicative inverse of a modulo m exists if and only if gcd(a, m) = 1, meaning a and m are coprime (share no common factors other than 1). If gcd(a, m) > 1, no inverse exists for that pair.

How do I find the modular inverse?

The most common method is the Extended Euclidean Algorithm, which finds integers x and y such that a·x + m·y = gcd(a, m). When gcd(a, m) = 1, the value x (taken modulo m) is the modular inverse of a. For small moduli, you can also check each value from 1 to m−1 by brute force.

What numbers have a multiplicative inverse modulo 10?

Only integers that are coprime with 10 have a modular inverse modulo 10. Those are 1, 3, 7, and 9 — the numbers from 1 to 9 that share no factor with 10. For example, 3⁻¹ mod 10 = 7 because 3 × 7 = 21 ≡ 1 (mod 10).

Does 101 have a multiplicative inverse modulo 4620?

Yes. Since gcd(101, 4620) = 1 (101 is prime and does not divide 4620), the modular inverse exists. You can verify this using the Extended Euclidean Algorithm or by entering the values into this calculator.

What is the difference between a multiplicative inverse and a modular multiplicative inverse?

The standard multiplicative inverse (reciprocal) of x is 1/x — a real number. The modular multiplicative inverse operates within modular arithmetic and is always an integer. For example, the reciprocal of 3 is 1/3, but the modular inverse of 3 mod 11 is 4, because 3 × 4 = 12 ≡ 1 (mod 11).

What is the purpose of the modular inverse in RSA encryption?

RSA encryption relies heavily on modular arithmetic. The modular inverse is used to compute the private key exponent d from the public key exponent e, satisfying e·d ≡ 1 (mod φ(n)), where φ(n) is Euler's totient of the RSA modulus n. Without the modular inverse, decryption would be impossible.

How do I find the additive inverse of 15 modulo 7?

The additive inverse of a modulo m is simply m − (a mod m). For 15 modulo 7: 15 mod 7 = 1, so the additive inverse is 7 − 1 = 6. This is different from the multiplicative inverse — note that this calculator computes the multiplicative inverse, not the additive one.

More Math Tools