Inverse Modulo Calculator

Enter a number a and a modulus n to find both the multiplicative inverse (a⁻¹ mod n) and the additive inverse (-a mod n). The Inverse Modulo Calculator checks if a multiplicative inverse exists using the GCD condition, then applies the Extended Euclidean Algorithm to compute results — plus shows step-by-step verification.

The integer whose modular inverse you want to find.

A positive integer greater than 1.

Results

Multiplicative Inverse (a⁻¹ mod n)

--

Additive Inverse (−a mod n)

--

GCD(a, n)

--

Multiplicative Inverse Exists?

--

Verification: (a × a⁻¹) mod n

--

Results Table

Frequently Asked Questions

What is inverse modulo?

The modular inverse of a number 'a' with respect to modulus 'n' refers to two types: the multiplicative inverse and the additive inverse. The multiplicative inverse of a (mod n) is a number x such that (a × x) ≡ 1 (mod n). The additive inverse of a (mod n) is a number y such that (a + y) ≡ 0 (mod n), which equals (n − a) mod n.

How do I find the modular multiplicative inverse?

The multiplicative inverse of a modulo n can be found using the Extended Euclidean Algorithm. This algorithm expresses GCD(a, n) as a linear combination of a and n. If GCD(a, n) = 1, the coefficient of a in that expression gives the inverse. You can also use Euler's theorem if n is prime, giving a⁻¹ ≡ a^(n−2) (mod n).

How do I check if the modular inverse exists?

A multiplicative inverse of a modulo n exists if and only if GCD(a, n) = 1, meaning a and n are coprime (share no common factors other than 1). If GCD(a, n) > 1, then no multiplicative inverse exists. An additive inverse always exists for any integer a and any modulus n ≥ 2.

Does 101 have a multiplicative inverse modulo 4620?

No, 101 does not have a multiplicative inverse modulo 4620 because GCD(101, 4620) = 1 means it should exist — actually GCD(101, 4620) = 1 since 101 is prime and does not divide 4620, so 101 does have a multiplicative inverse modulo 4620. You can verify this by running the Extended Euclidean Algorithm on 101 and 4620.

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

The additive inverse of 15 modulo 7 is calculated as (7 − (15 mod 7)) mod 7. Since 15 mod 7 = 1, the additive inverse is (7 − 1) mod 7 = 6. You can verify: (15 + 6) mod 7 = 21 mod 7 = 0 ✓.

What numbers have multiplicative inverses modulo 10?

Only numbers coprime to 10 have multiplicative inverses modulo 10. Since 10 = 2 × 5, any number not divisible by 2 or 5 will work. Among 1–9, these are: 1, 3, 7, and 9. For example, 3 × 7 = 21 ≡ 1 (mod 10), so 3 and 7 are inverses of each other.

Can a number be its own modular multiplicative inverse?

Yes! A number a is its own multiplicative inverse modulo n when a² ≡ 1 (mod n). For example, 1 is always its own inverse (1 × 1 = 1), and so is n−1 (since (n−1)² = n²−2n+1 ≡ 1 mod n). Other self-inverses exist for specific moduli.

What is the difference between additive and multiplicative modular inverse?

The additive inverse of a mod n is the number y such that a + y ≡ 0 (mod n), giving y = (n − a mod n) mod n — it always exists. The multiplicative inverse of a mod n is the number x such that a × x ≡ 1 (mod n) — it only exists when GCD(a, n) = 1. They solve fundamentally different modular equations.

More Math Tools