Inverse Modulo Calculator
Calculate modular inverses with the extended Euclidean algorithm, Bezout identity, gcd checks, and target congruence solving.
Last Updated: May 2026
Modular inverse
5
GCD
1
Normalized value
3
Check
1 mod 7
Inverse Modulo Inputs
Enter an integer value and a modulus greater than 1. The calculator normalizes the value, runs extended Euclid, and verifies whether the inverse exists.
Optional context for solving a x = b mod m.
Inverse Proof
| Check | Calculation | Result |
|---|---|---|
| Congruence | 3 x inverse = 1 mod 7 | Solvable |
| Coprime test | gcd(3, 7) | 1 |
| Bezout identity | 3 x -2 + 7 x 1 | 1 |
| Inverse check | 3 x 5 mod 7 | 1 |
Target Congruence
| Item | Calculation | Result |
|---|---|---|
| Target congruence | 3 x = 1 mod 7 | Solvable |
| Solution | x = inverse x target mod 7 | 5 |
| Verification | 3 x 5 mod 7 | 1 |
Euclidean Algorithm Steps
| Division step | Note |
|---|---|
| 3 = 7 x 0 + 3 | Continue with divisor and remainder. |
| 7 = 3 x 2 + 1 | Continue with divisor and remainder. |
| 3 = 1 x 3 + 0 | GCD is 1 |
Number Theory Notice
This calculator is for integer modular arithmetic and educational number theory. For cryptographic production systems, use audited libraries and verified parameter handling rather than manual calculations.
Reviewed For Methodology, Labels, And Sources
Every CalculatorWallah calculator is published with visible update labeling, linked source references, and founder-led review of formula clarity on trust-sensitive topics. Use results as planning support, then verify institution-, policy-, or jurisdiction-specific rules where they apply.
Reviewed By
Jitendra Kumar, Founder & Editorial Standards Lead, oversees methodology standards and trust-sensitive publishing decisions.
Review editor profileTopic Ownership
Sales tax and tax-sensitive estimate tools, Education and GPA planning calculators, Health, protein, and screening-formula pages, Platform-wide publishing standards and methodology
See ownership standardsMethodology & Updates
Page updated May 2026. Trust-critical pages are reviewed when official rates or rules change. Evergreen calculator guides are checked on a recurring quarterly or annual cycle depending on topic volatility.
How to Use the Inverse Modulo Calculator
Enter the value a and modulus m. The modulus must be greater than 1. The calculator reduces a modulo m, checks gcd(a,m), and reports the inverse when it exists.
Use the target field when you want to solve a linear congruence in the form a x = b mod m. When the inverse exists, the solution is inverse times b modulo m.
Step 1: Enter the value
This is the integer whose modular inverse you want.
Step 2: Enter the modulus
Use an integer modulus greater than 1.
Step 3: Check the inverse result
The calculator shows the inverse only when gcd(value, modulus) is 1.
Step 4: Review the proof
Use the Bezout identity and Euclidean steps to verify why the inverse exists or fails.
How This Inverse Modulo Calculator Works
A modular inverse is the number that turns multiplication into 1 within a modulus. If x is the inverse of a modulo m, then a x has remainder 1 after division by m.
The inverse exists only when a and m are coprime. The calculator proves that condition with the extended Euclidean algorithm, which finds coefficients in the equation a x + m y = gcd(a,m).
When the gcd equals 1, the coefficient of a is normalized into the range 0 through m - 1 and returned as the modular inverse.
Modular Inverse Guide
Core Formulas
| Concept | Formula | Use |
|---|---|---|
| Modular inverse | a x a^-1 = 1 mod m | Defines the inverse of a modulo m. |
| Existence test | gcd(a, m) = 1 | An inverse exists exactly when a and m are coprime. |
| Bezout identity | a x + m y = gcd(a, m) | Extended Euclid finds the coefficient x. |
| Inverse from Bezout | a x + m y = 1 implies a x = 1 mod m | Normalize x into 0 through m - 1. |
| Modular division | a x = b mod m, so x = a^-1 b mod m | Works when the inverse exists. |
Examples
| Problem | Result | Notes |
|---|---|---|
| 3 inverse mod 7 | 5 | 3 x 5 = 15 = 1 mod 7. |
| 17 inverse mod 3120 | 2,753 | Common RSA-style private exponent example. |
| 12 inverse mod 18 | Does not exist | gcd(12,18) = 6, so the inverse test fails. |
| -11 inverse mod 26 | 7 | -11 is normalized to 15, and 15 x 7 = 1 mod 26. |
Modular Inverse Context
Modular inverses let you divide inside modular arithmetic. Since direct division is not generally available modulo m, multiplying by an inverse fills that role when the inverse exists.
This is why the coprime check matters. Prime moduli make every nonzero residue invertible, while composite moduli have values that fail the gcd test.
Keep the research moving with Modulo Calculator, LCM Calculator, LCM / GCF Calculator, and Long Multiplication Calculator.
Frequently Asked Questions
Related Calculators
Modulo Calculator
Calculate remainders, quotients, congruence checks, and modular operations.
Use Modulo CalculatorLCM Calculator
Calculate least common multiples with pairwise steps and prime factors.
Use LCM CalculatorLCM / GCF Calculator
Calculate greatest common factors, least common multiples, and Euclidean steps.
Use LCM / GCF CalculatorLong Multiplication Calculator
Multiply long integers or decimals with partial products and carry steps.
Use Long Multiplication CalculatorScientific Calculator
Use advanced arithmetic, powers, roots, logarithms, and trigonometry.
Use Scientific CalculatorSources & References
- 1.Wolfram MathWorld - Modular Inverse(Accessed May 2026)
- 2.Khan Academy - Modular Inverses(Accessed May 2026)
- 3.Wolfram Language Documentation - ModularInverse(Accessed May 2026)