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.
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
Exists only when gcd(a,m)=1.
For prime m (Fermat): x = a^(m−2) mod m
Step-by-Step
- Enter a and modulus m.
- Check gcd(a, m).
- Apply Extended Euclidean Algorithm.
- Extract inverse coefficient x.
- Normalize x to [0, m-1].
Worked Example
Use Extended Euclidean:
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.