Skip to content
D DocNectar

Free Inverse Modulo Calculator

Calculate the modular multiplicative inverse of a mod m using the extended Euclidean algorithm.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

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.

  1. Enter a.
  2. Enter m (modulus).
  3. 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.

Frequently asked questions

If a and m share a common factor greater than 1, no multiple of a can ever land exactly on a remainder of 1 modulo m, because every multiple of a modulo m must also share that same common factor with m.
Modular inverses are essential in cryptography (including RSA), solving linear congruences, and modular arithmetic more generally, wherever "dividing" by a number modulo m is needed.

Get new calculators and guides in your inbox

No spam — just new tools like Inverse Modulo Calculator and practical guides.

Favorites