K

Modular Inverse Calculator

Modular multiplicative inverse a⁻¹ mod m

Client-side computation for analysis, verification, and learning. Do not paste production secrets into untrusted sites; prefer local tooling for key material.

Educational / engineering use. RSA mode uses tiny primes for illustration only—not for real key generation.

a
modulus m

Add Modular Inverse Calculator Free On Your Website

Paste this HTML on your site.

What is Modular Inverse Calculator?

Finds the integer x such that (a × x) ≡ 1 (mod m). Essential in cryptography, particularly in RSA key generation and solving linear congruences.

Modular Inverse Formula

ax1(modm)a · x ≡ 1 (mod m)
x=a(1)(modm)x = a^(−1) (mod m)

Exists only when gcd(a,m)=1.

For prime m (Fermat): x = a^(m−2) mod m

Step-by-Step

  1. Enter a and modulus m.
  2. Check gcd(a, m).
  3. Apply Extended Euclidean Algorithm.
  4. Extract inverse coefficient x.
  5. Normalize x to [0, m-1].

Worked Example

Findxsuchthat3x1(mod7).Find x such that 3x ≡ 1 (mod 7).

Use Extended Euclidean:

7=23+17 = 2*3 + 1
1=7231 = 7 - 2*3
Soinverseof3mod7isx=25(mod7).So inverse of 3 mod 7 is x = -2 ≡ 5 (mod 7).
Verification:35=151(mod7).Verification: 3*5 = 15 ≡ 1 (mod 7).

Where Modular Inverse Calculator Is Applied

  • RSA private key calculation (d=e−1 mod φ(n))
  • Solving linear congruences in number theory
  • Elliptic Curve Cryptography (ECC) point operations
  • Secret sharing schemes (Shamir's Secret Sharing)
  • Error correction codes (Reed-Solomon)
  • Cryptographic protocol implementations

Related Cryptography Calculators

Explore similar calculators to streamline your workflow.

View all
Calculator By Adil Balti, Content Proofread and Verify by Muhammad Kumail & Gulzar Abbas.

About Calculators.is

At Calculators.is our sole focus is to provide 100% accurate, fast, comprehensive, convenient, easy-to-use free online calculators to everyone to use without spending a single $ on any online Calculators.

All the calculators on our website are designed and developed by our own team, and each one is put through strict, comprehensive testing before being made live on our website.

About, Founder and calculator.is.