Explore modular inverses with steps, instant validation, guided hints, clarity everywhere. Support complex inputs, coprime checks, Bezout coefficients, negative normalization, error alerts built-in. Download structured results, analyze examples, and quickly master concepts for challenging exams. Ideal for coders, researchers, teachers, and curious problem solvers.
Enter values for a and m, optionally enable batch processing or table generation, then press Calculate Inverse to see detailed steps, verification, multiple results, and exportable tables.
| # | Source | a | m | a mod m | gcd(a, m) | Inverse (0 ≤ x < m) | Raw x (EEA) | Verification (a·x mod m) | Notes |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Example | 3 | 11 | 3 | 1 | 4 | -7 | (3 × 4) mod 11 = 1 | Example: 4 is inverse of 3 modulo 11. |
Use this table as a reference for typical modular inverse problems.
| a | m | Inverse x (0 ≤ x < m) | Check (a·x mod m) |
|---|---|---|---|
| 3 | 7 | 5 | (3 × 5) mod 7 = 1 |
| 5 | 11 | 9 | (5 × 9) mod 11 = 1 |
| 7 | 26 | 15 | (7 × 15) mod 26 = 1 |
| 17 | 43 | 38 | (17 × 38) mod 43 = 1 |
Suppose you want the modular inverse of a = 17 modulo m = 43.
For integers a and m with gcd(a, m) = 1, the modular multiplicative inverse of a modulo m is an integer x such that:
a · x ≡ 1 (mod m)
Using the Extended Euclidean Algorithm, we find integers x and y satisfying a·x + m·y = gcd(a, m) = 1. The value of x, reduced into the range 0 ≤ x < m, is the modular inverse of a modulo m.
For prime moduli, Fermat's little theorem provides an alternative: a^(m-2) mod m gives the inverse when a and m are coprime.
If gcd(a, m) ≠ 1, the tool clearly reports that no modular inverse exists and helps you spot which inputs must be adjusted.
This calculator combines the Extended Euclidean Algorithm, optional Fermat-based verification, batch processing, quick modulus presets, and inverse table generation into one interface. It highlights coprime checks, normalization, and verification so learners and professionals can trust every displayed result.
Modular inverses are essential in RSA key operations, Chinese Remainder Theorem applications, affine ciphers, linear congruence solving, fraction handling under modulus, and modular combinatorics. Presets like 1,000,000,007 and 998,244,353 target real contest and library scenarios.
The tool automatically checks gcd(a, m). If the gcd is greater than 1, it flags the failure, explains the cause, and encourages selecting values where a and m are coprime to make the modular inverse possible.
A modular multiplicative inverse of a modulo m is a value x such that a·x ≡ 1 (mod m). This calculator finds x when it exists, with normalization and verification.
An inverse does not exist when gcd(a, m) ≠ 1. In that case, a and m share a common factor, so no integer x can satisfy a·x ≡ 1 (mod m).
Yes. The tool accepts negative values and large integers. It normalizes inputs into the correct residue class and uses efficient algorithms suitable for contests, cryptography, and advanced coursework.
Use the Extended Euclidean Algorithm for all moduli. Fermat’s method applies only when m is prime and a is not divisible by m. Auto mode safely combines both when appropriate.
It visualizes steps, confirms results, supports batch problems, and generates tables. This structure helps students, teachers, and developers understand modular arithmetic instead of trusting black-box outputs.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.