Home Back

Inverse Mod Calculator

Modular Inverse:

\[ x \text{ where } a \times x \equiv 1 \mod m \]

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is Modular Inverse?

The modular 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 when a and m are coprime (gcd(a, m) = 1).

2. How Does the Calculator Work?

The calculator uses the extended Euclidean algorithm to find the modular inverse:

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

Where:

Explanation: The calculator checks all numbers from 1 to m-1 to find one that satisfies the equation. If none exists, it returns "No inverse exists".

3. Applications of Modular Inverse

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

4. Using the Calculator

Tips: Enter positive integers for both a and m. The calculator will find x such that (a × x) mod m = 1, or indicate if no solution exists.

5. Frequently Asked Questions (FAQ)

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

Q2: What's the time complexity of finding modular inverse?
A: The extended Euclidean algorithm runs in O(log min(a, m)) time, much faster than brute-force search.

Q3: Can m be negative?
A: No, the modulus m must be a positive integer greater than 1.

Q4: What's the difference between mod inverse and division?
A: Modular inverse is the multiplicative inverse in modular arithmetic, not the same as regular division.

Q5: How is this used in cryptography?
A: RSA encryption uses modular inverses to compute private keys from public keys.

Inverse Mod Calculator© - All Rights Reserved 2025