Maths & numbers

Modular inverse calculator

Find the multiplicative inverse modulo an integer using Bézout coefficients.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Verify the result by multiplying it by the input and reducing the product modulo the chosen modulus.

THE FORMULAax ≡ 1 (mod m)

A worked example

7 × 15 = 105, which leaves remainder 1 modulo 26.

Good to know

An inverse exists exactly when the input and modulus are coprime.

Read the result

Find the multiplicative inverse modulo an integer using Bézout coefficients.

The primary result is labeled “Least nonnegative inverse”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

An inverse exists exactly when the input and modulus are coprime.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

7 × 15 = 105, which leaves remainder 1 modulo 26.

Which rule does this calculator apply?

ax ≡ 1 (mod m)

Find your calculator

Start typing to explore the library.