Intermediate

Multiplicative Inverse Modulo Calculator

Compute the multiplicative inverse of a modulo m: the integer x in [0, m) satisfying a · x ≡ 1 (mod m). Shows the full extended Euclidean derivation and verifies the result.
Any integer — negatives are reduced automatically
Must be ≥ 2
Multiplicative inverse
7⁻¹ ≡ 15 (mod 26)
Inverse x
15
a reduced mod m
7
gcd(a, m)
1
Verify: a · x mod m
1
Extended Euclidean algorithm
1

Reduce a into [0, m)

7 mod 26 = 7
2

Confirm gcd(a mod m, m) = 1 (inverse exists)

gcd(7, 26) = 1 ✓
3

Extended Euclidean gives Bezout coefficient x

x = -11
4

Normalize x into [0, m)

((-11 mod 26) + 26) mod 26 = 15
=

Verify: 7 × 15 mod 26

= 1 ✓
03.36.59.81316.319.522.826x=15The inverse x lies within [0, m)
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

The multiplicative inverse of a mod m is the integer x in [0, m) where a · x ≡ 1 (mod m). It exists only when gcd(a, m) = 1 and is found via the extended Euclidean algorithm (Bezout identity), then normalized to a positive residue. Uses: RSA key derivation, multiplicative cipher reversal, solving linear congruences.

Formula
a · x ≡ 1 (mod m), x = ExtGCD(a, m).x normalized to [0, m), exists iff gcd(a, m) = 1
How this is calculated

The multiplicative inverse of a modulo m is the integer x (in the range [0, m)) satisfying a · x ≡ 1 (mod m). It is the modular equivalent of the reciprocal 1/a — multiplying a by its inverse and reducing by m always gives 1. The inverse exists if and only if a and m are coprime, i.e. gcd(a, m) = 1. If they share any common factor, no solution exists.

The extended Euclidean algorithm finds the inverse efficiently. Starting from gcd(a mod m, m), it traces back through the Bezout identity — integers x and y such that a·x + m·y = gcd(a, m) = 1 — and the coefficient x is then normalized into [0, m) to give the final inverse. Negative values of a are reduced into [0, m) first so the algorithm always operates on non-negative inputs.

Common applications include RSA cryptography (finding the private exponent d where e·d ≡ 1 mod φ(n)), reversing multiplicative ciphers (with m = 26 for the English alphabet), and solving linear congruences a·x ≡ b (mod m) by multiplying both sides by the modular inverse of a.

Frequently asked questions

It exists precisely when a and m are coprime — gcd(a, m) = 1. If they share any common factor greater than 1, no integer x satisfies a · x ≡ 1 (mod m). When m is prime, every a from 1 to m−1 has an inverse because all are coprime to m.

RSA key generation requires finding the private exponent d such that e · d ≡ 1 (mod φ(n)), where φ(n) is Euler's totient of the key modulus. The private key d is exactly the multiplicative inverse of the public exponent e modulo φ(n), computed via the extended Euclidean algorithm.

The 26 letters of the English alphabet are numbered 0–25. A multiplicative cipher encodes each letter by multiplying its number by a key k modulo 26. Decoding requires the multiplicative inverse of k mod 26. Not all keys are invertible — only those coprime to 26 work (not multiples of 2 or 13).

Also known as

multiplicative inverse modulo n
modular inverse calculator
inverse mod m
extended euclidean inverse
find x where ax equals 1 mod m
coprime inverse modular arithmetic
modular multiplicative inverse

APA

TG we-Calculate Editorial Team. (2026). Multiplicative Inverse Modulo Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/multiplicative-inverse-modulo-calculator

Chicago

TG we-Calculate Editorial Team. "Multiplicative Inverse Modulo Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/multiplicative-inverse-modulo-calculator.

IEEE

TG we-Calculate Editorial Team, "Multiplicative Inverse Modulo Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/multiplicative-inverse-modulo-calculator

BibTeX

@misc{wecalculate_multiplicative_inverse_modulo_calculator, title = {Multiplicative Inverse Modulo Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/multiplicative-inverse-modulo-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?