Math

Modular Inverse Calculator

Find x where a·x ≡ 1 (mod m), with the GCD check.

Enter your values

Enter the value a you are working with.

Enter the modulus m you are working with.

Results update instantly as you type — no submit needed. Your values are remembered on this device, and the shareable link reopens the calculator with exactly these numbers.

Results
Modular inverse
38
Check
17 × 38 mod 43 = 1
gcd(a, m)
1
Coprime?
Yes — the inverse exists
a mod m
17

Quick answer

The modular inverse of a mod m is the x with a·x ≡ 1 (mod m); it exists only when a and m are coprime.

a·x ≡ 1 (mod m)

At a glance

What it doesFind x where a·x ≡ 1 (mod m), with the GCD check.
CategoryMath
Inputs neededValue a, Modulus m
Main outputModular inverse
Formulaa·x ≡ 1 (mod m)
CostFree — no sign-up, no download

How to use the Modular Inverse Calculator

  1. 1Enter the value you want to invert.
  2. 2Enter the modulus.
  3. 3If the GCD is not 1 there is no inverse — pick a different modulus.

Inputs explained

Value a
Enter the value a you are working with.
Modulus m
Enter the modulus m you are working with.

Worked example

Using the values the calculator loads with:

Inputs

  • Value a17
  • Modulus m43

Results

  • Modular inverse38
  • Check17 × 38 mod 43 = 1
  • gcd(a, m)1
  • Coprime?Yes — the inverse exists
  • a mod m17

Frequently asked questions

Where are modular inverses used?

RSA key generation, hash tables, error-correcting codes and any modular arithmetic where you need to 'divide'.

Why must a and m be coprime?

If they share a factor, every multiple of a stays inside that factor's subgroup and can never reach 1.

What do I need to enter into the Modular Inverse Calculator?

Just 2 values: value a, modulus m. Every field starts with a realistic example, so you can change one number at a time and watch the result update instantly.

How does the Modular Inverse Calculator work out the answer?

The modular inverse of a mod m is the x with a·x ≡ 1 (mod m); it exists only when a and m are coprime. It applies the formula a·x ≡ 1 (mod m) and shows the working so you can check each step by hand.

Is the Modular Inverse Calculator free, and do I need an account?

It is completely free with no sign-up, no download and no usage limit. Everything is calculated in your browser, so the numbers you type never leave your device.

Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.