CalculatorWallah logoCalculatorWallah

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

CheckCalculationResult
Congruence3 x inverse = 1 mod 7Solvable
Coprime testgcd(3, 7)1
Bezout identity3 x -2 + 7 x 11
Inverse check3 x 5 mod 71

Target Congruence

ItemCalculationResult
Target congruence3 x = 1 mod 7Solvable
Solutionx = inverse x target mod 75
Verification3 x 5 mod 71

Euclidean Algorithm Steps

Division stepNote
3 = 7 x 0 + 3Continue with divisor and remainder.
7 = 3 x 2 + 1Continue with divisor and remainder.
3 = 1 x 3 + 0GCD 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 profile

Topic 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 standards

Methodology & 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.

  1. Step 1: Enter the value

    This is the integer whose modular inverse you want.

  2. Step 2: Enter the modulus

    Use an integer modulus greater than 1.

  3. Step 3: Check the inverse result

    The calculator shows the inverse only when gcd(value, modulus) is 1.

  4. 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

ConceptFormulaUse
Modular inversea x a^-1 = 1 mod mDefines the inverse of a modulo m.
Existence testgcd(a, m) = 1An inverse exists exactly when a and m are coprime.
Bezout identitya x + m y = gcd(a, m)Extended Euclid finds the coefficient x.
Inverse from Bezouta x + m y = 1 implies a x = 1 mod mNormalize x into 0 through m - 1.
Modular divisiona x = b mod m, so x = a^-1 b mod mWorks when the inverse exists.

Examples

ProblemResultNotes
3 inverse mod 753 x 5 = 15 = 1 mod 7.
17 inverse mod 31202,753Common RSA-style private exponent example.
12 inverse mod 18Does not existgcd(12,18) = 6, so the inverse test fails.
-11 inverse mod 267-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

A modular inverse of a modulo m is an integer x such that a times x leaves a remainder of 1 when divided by m.

A modular inverse exists exactly when the value and modulus are coprime, meaning their greatest common divisor is 1.

It uses the extended Euclidean algorithm to find integers x and y where a x + m y equals gcd(a,m). When the gcd is 1, x is the inverse modulo m after normalization.

Yes. The calculator first reduces the value into the standard modulo range from 0 to m - 1, then computes the inverse.

If a and m share a factor larger than 1, every product a x shares that factor modulo m, so it cannot be congruent to 1.

Modular inverses are used in modular division, solving linear congruences, cryptography, RSA examples, hashing, and number theory.

Related Calculators

Sources & References

  1. 1.Wolfram MathWorld - Modular Inverse(Accessed May 2026)
  2. 2.Khan Academy - Modular Inverses(Accessed May 2026)
  3. 3.Wolfram Language Documentation - ModularInverse(Accessed May 2026)