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
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
- Inputs are integers; modulus m must be from 2 through 1,000,000,000,000, and |a| may not exceed that bound.
- An inverse does not exist when a and m are not coprime. The tool reports that condition rather than returning a remainder as an inverse.
- This educational arithmetic tool is not cryptographic security advice or a vetted cryptographic implementation.
References
These sources support the stated formula, convention or context. Read the limitations above before using the estimate.
Related calculators
Friendly Calculator provides general educational tools. Check the method and assumptions before relying on any result.