Multiplicative Inverse Modulo Calculator

Find modular multiplicative inverses with clarity and confidence today. Uses Extended Euclidean Algorithm with intermediate reductions explained clearly. Supports big numbers, negatives, and non-coprime detection instantly too. Share results, copy steps, download CSV, or PDF. Clean interface, white theme, responsive layout for professionals everywhere.

Inputs

Please enter an integer (e.g., -123, 0, 456).
Please enter an integer greater than 1.
Reset

Example Data

# a m Expected inverse
13114
2101712
3143326
412345610000333792
5-1910185

Click Use to auto-fill inputs from the row.

Result

Enter values and click Calculate to see the inverse and steps.

Formula Used

We solve a · x ≡ 1 (mod m). An inverse exists iff gcd(a, m) = 1. Using the Extended Euclidean Algorithm, find integers u, v such that u·m + v·a = gcd(a, m). When gcd = 1, the inverse is x ≡ v (mod m).

At termination: old_s·m + old_t·a_norm = gcd(a, m).
If gcd = 1 ⇒ a_norm·old_t ≡ 1 (mod m) ⇒ inverse ≡ old_t (mod m).

How to Use

  1. Enter any integer a and modulus m > 1.
  2. Click Calculate. The tool normalizes negative or large a to [0, m-1].
  3. View whether an inverse exists and, if yes, its least positive residue.
  4. Inspect the Extended Euclidean steps and Bezout coefficients.
  5. Export the results to CSV or PDF, or copy the summary.

Tip: Use the shareable link to preserve inputs for bookmarking or sharing.

FAQs

For integers a and m>1, an inverse is an integer x with a·x ≡ 1 (mod m). It’s unique modulo m.

An inverse exists iff gcd(a, m) = 1. If gcd > 1, the congruence a·x ≡ 1 has no solution.

We reduce a modulo m to a canonical representative in [0, m-1]. The inverse is returned as the least positive residue.

All inverses are congruent modulo m. We report the smallest non-negative one; any other differs by a multiple of m.

Multiply a by the reported inverse and reduce modulo m. The remainder must be 1.

RSA Mini Examples (d = e-1 mod φ(n))

These toy examples show the inverse of the public exponent e modulo φ(n), producing the secret exponent d when it exists.

# p q n = p·q φ(n) e d Note
1535931273016172129
24347202119325773
36153323331203No inverse, e not coprime with φ(n)

In practice use large safe primes and adequate padding; these are illustrative only.

Reference: Inverses for Small Moduli

Quick lookup of a^{-1} (mod m) for small m and several a values.

# m a inverse gcd(a,m)
17241
27351
37421
47531
511261
611341
711431
811591
913271
1013391
11134101
1213581
1317291
1417361
15174131
1617571

Rows with “—” indicate no inverse because a shares a factor with m.

Related Calculators

Proportion and Ratio Calculatorsquare root calculator with stepsnegative square root calculatorfraction square root calculatorsquare root division calculatordecimal to square root calculatorderivative of square root calculatorharmonic mean calculatorbinomial distribution mean calculatordiscrete random variable mean calculator

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.