Home / All calculators / Multiplicative Inverse Modulo Calculator

Mathematics, Numbers & Statistics · Free online calculator

Multiplicative Inverse Modulo Calculator

Find the least non-negative multiplicative inverse x for an integer a modulo m. The inverse exists only when gcd(a,m) = 1.

Calculator

The tool returns the least non-negative inverse, if one exists.

Enter values and calculate.

Formula

Find integers u and v with au + mv = gcd(a,m) using the extended Euclidean algorithm. If gcd(a,m)=1, the inverse is x = u mod m, normalized to 0 ≤ x < m; otherwise no inverse exists.

The calculation runs in your browser. Check units and assumptions before relying on a result.

Worked example

For a = 17 and m = 43, 17 × 38 = 646 = 15 × 43 + 1. Therefore 38 is the inverse of 17 modulo 43.

Assumptions and limitations

References

These sources support the stated formula, convention or context. Read the limitations above before using the estimate.

  1. CP-Algorithms — Modular Multiplicative Inverse
  2. Di-Mgt — Euclidean Algorithm and Modular Inverses
  3. Extended Euclidean Algorithm — Multiplicative Inverse Tutorial

Related calculators

LCM & HCF Calculator · Basic Calculator · All calculators

Friendly Calculator provides general educational tools. Check the method and assumptions before relying on any result.