Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
The modular multiplicative inverse of a mod m is the number that, when multiplied by a, gives a result of 1 modulo m — the modular equivalent of a reciprocal. This tool computes it using the extended Euclidean algorithm.
How it works
The inverse exists only when gcd(a, m) = 1. When it does, the extended Euclidean algorithm expresses 1 as a linear combination of a and m, and the coefficient on a (reduced modulo m) is the modular inverse.
- Enter a.
- Enter m (modulus).
- Click Calculate to see your results.
Examples
A classic modular inverse
The inverse of 3 mod 11 is 4, since (3 × 4) mod 11 = 12 mod 11 = 1.
Who should use it
- Cryptography coursework and RSA-related calculations.
- Solving linear congruences of the form ax ≡ b (mod m).
Industry applications
- Cryptography and information security
- Computer science and number theory education
Advantages
- Shows the full Euclidean algorithm gcd check plus the resulting inverse.
- Clearly explains why no inverse exists when gcd ≠ 1.
Limitations
- Only computes a single modular inverse — does not solve full linear congruence systems (see the Chinese Remainder Theorem Calculator for systems).
Common mistakes to avoid
- Trying to compute a modular inverse when gcd(a, m) is not 1 — no inverse exists in that case, and any answer produced would be incorrect.
Best practices
- Always verify gcd(a, m) = 1 first (the tool does this automatically) before relying on a modular inverse in a larger calculation.
Tips
- If gcd(a, m) ≠ 1, check whether a and m can be reduced by their common factor first — sometimes an inverse exists for a reduced version of the problem even if not for the original values.