Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Modular Exponentiation CalculatorExtended Euclidean Algorithm CalculatorChinese Remainder Theorem CalculatorContinued Fraction CalculatorPrimitive Root CalculatorRing and Field CalculatorReptile Habitat UVB Calculator
Home Page > Math > Advanced Math Operations

Modular Multiplicative Inverse Calculator

Calculate the modular multiplicative inverse of an integer a under modulo m using the Extended Euclidean Algorithm, with step-by-step table, verification, and clock visualization.

Free to useNo sign-up requiredUpdated Feb 2026
Modular Multiplicative Inverse CalculatorTry it now — free ▼
⚡ Quick Examples
Any non-zero integer
Positive integer ≥ 2

Embed Modular Multiplicative Inverse Calculator Widget

About Modular Multiplicative Inverse Calculator

What Is the Modular Multiplicative Inverse?

The modular multiplicative inverse of an integer a with respect to modulus m is an integer x in the range [0, m-1] such that:

\( a \cdot x \equiv 1 \pmod{m} \)

It is written as a⁻¹ (mod m) and is analogous to the multiplicative inverse in ordinary arithmetic (i.e., 1/a), but in the world of modular arithmetic.

Key condition: The inverse exists if and only if gcd(a, m) = 1 — that is, a and m must be coprime.

How It Is Calculated: Extended Euclidean Algorithm

The most efficient method uses the Extended Euclidean Algorithm. It finds integers x and y satisfying Bézout's identity:

\( a \cdot x + m \cdot y = \gcd(a, m) = 1 \)

When gcd(a, m) = 1, taking both sides mod m gives a·x ≡ 1 (mod m), so x is the modular inverse.

Example: Find 3⁻¹ (mod 7):

Extended GCD gives: 3·(5) + 7·(-2) = 15 − 14 = 1, so 3⁻¹ ≡ 5 (mod 7). Verify: 3 × 5 = 15 = 2×7 + 1 ≡ 1 (mod 7) ✓

Applications in Cryptography & Mathematics

🔐
RSA Encryption
Finding the private key d = e⁻¹ (mod φ(n)) from public exponent e
📈
Diffie-Hellman
Key exchange protocol based on discrete logarithms in modular arithmetic
🇮
Affine Cipher
Decryption uses a⁻¹ (mod 26) to reverse the encryption key
🔢
CRT & Number Theory
Chinese Remainder Theorem and solving linear congruences ax ≡ b (mod m)
👑
Elliptic Curves
Point addition formulas in ECC require modular inverses for slope computation
📋
Modular Fractions
Computing a/b (mod m) as a · b⁻¹ (mod m) when gcd(b, m) = 1

Frequently Asked Questions

Q: Why does the inverse not always exist?
Because modular arithmetic "wraps around," some multiples of a may never land on 1 mod m. This happens exactly when a and m share a common factor — i.e., gcd(a, m) > 1.
Q: Is there a formula for prime modulus?
Yes! If m is prime and a is not a multiple of m, Fermat's Little Theorem gives: a⁻¹ ≡ am-2 (mod m). This is often used in competitive programming.
Q: Is the result unique?
Yes, the result is unique modulo m. We always report the canonical result in [0, m-1]. Other valid inverses are x + km for any integer k, but they are all equivalent mod m.
Q: What if a is negative?
The algorithm handles negative integers. Internally we compute a (mod m) to get a non-negative representative first, then find its inverse. The result is always in [0, m-1].

Reference this content, page, or tool as:

"Modular Multiplicative Inverse Calculator" at https://MiniWebtool.com/modular-multiplicative-inverse-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Feb 18, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Advanced Math Operations:

Top & Updated:

Inverse Laplace Transform CalculatorMatrix Inverse CalculatorInverse Function CalculatorView all →
Home Page > Math > Advanced Math Operations > Modular Multiplicative Inverse Calculator