Home Back

Multiplicative Inverse Mod Calculator

Modular Multiplicative Inverse:

\[ a \times x \equiv 1 \mod m \]

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is Modular Multiplicative Inverse?

The modular multiplicative inverse of an integer a modulo m is an integer x such that the product a × x is congruent to 1 modulo m. It exists only if a and m are coprime (gcd = 1).

2. How Does the Calculator Work?

The calculator uses the extended Euclidean algorithm to find integers x and y such that:

\[ a \times x + m \times y = \gcd(a, m) \]

When gcd(a, m) = 1, the value of x (mod m) is the modular inverse of a.

3. Applications of Modular Inverse

Details: Modular inverses are essential in cryptography (RSA algorithm), solving linear congruences, and computer algebra systems.

4. Using the Calculator

Tips: Enter integer a and modulus m (must be > 1). The calculator will find x such that a × x ≡ 1 mod m, or indicate if no inverse exists.

5. Frequently Asked Questions (FAQ)

Q1: When does the modular inverse exist?
A: The inverse exists if and only if a and m are coprime (gcd(a, m) = 1).

Q2: How is this different from division?
A: Modular inverse is the equivalent of reciprocal in modular arithmetic. Instead of dividing by a, you multiply by its inverse.

Q3: What's the time complexity?
A: The extended Euclidean algorithm runs in O(log min(a, m)) time.

Q4: Can modulus be negative?
A: The modulus m must be positive (m > 1). The integer a can be negative.

Q5: What if multiple inverses exist?
A: The inverse is unique modulo m. All solutions are congruent modulo m.

Multiplicative Inverse Mod Calculator© - All Rights Reserved 2025