Modular Inverse Calculator

    Find the modular multiplicative inverse of an integer modulo m with an Extended Euclidean Algorithm check.

    Find a modular multiplicative inverse

    English SERP intent for this topic is modular arithmetic: users want the value x that makes a times x leave remainder 1 modulo m. The reciprocal fraction mode is secondary; the modular inverse mode is the primary tool.

    The inverse exists exactly when a and m are coprime.

    1. Enter the integer a.
    2. Enter the modulus m, at least 2.
    3. Use the result and the product-remainder check to verify the inverse.

    When no inverse exists

    If gcd(a,m) is greater than 1, no modular inverse exists. The Extended Euclidean Algorithm exposes that condition and supplies the coefficient that becomes the inverse when the gcd is 1.

    InputResult
    3 mod 114, because 3 x 4 leaves remainder 1
    17 mod 31202753
    6 mod 9No inverse because gcd(6,9)=3

    Frequently Asked Questions

    Sources and References

    Calculations are based on the listed reference sources. Links open in a new tab.

    Updated:

    Related Tools