← All text tools

Modular inverse calculator

Find the modular multiplicative inverse of a number with the extended Euclidean algorithm, shown step by step, and check that the product leaves remainder one.

  • Free
  • No sign-up
  • Works on any device

About Modular inverse calculator

The modular inverse of a modulo m is the number x with a times x leaving remainder 1 when divided by m. It exists only when a and m share no common factor. The extended Euclidean algorithm finds it by running Euclid's gcd steps while tracking the coefficients that express each remainder as a combination of a and m; the table shows every quotient, remainder and coefficient. The default example, e = 17 and m = 3120, gives d = 2753, a classic RSA key pair. Large integers are handled exactly.

How to use Modular inverse calculator

  1. Enter the number a and the modulus m as whole numbers.
  2. Read the inverse and the check line that shows a times the inverse leaving remainder 1.
  3. Follow the table of quotients and coefficients to see how the result was reached.

Why use this tool?

Also known as

Frequently asked questions

When does a modular inverse not exist?

When a and m have a common factor greater than 1. For example 6 has no inverse modulo 9, since both are divisible by 3. The page shows the gcd in that case.

Can a be negative or larger than m?

Yes. The calculator first reduces a modulo m, so -3 modulo 11 is treated as 8. The reduced value is shown.

What is this used for?

It is used to divide in modular arithmetic, solve linear congruences, and compute the private exponent d in RSA from the public exponent e.

Is Modular inverse calculator free?

Yes. Modular inverse calculator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Modular inverse calculator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools