Inverse Modulo Calculator with Steps

Find modular inverses fast with guided extended Euclid steps for clarity. Supports negative inputs, automatic reductions, and prime or composite moduli with validation. Process multiple pairs, copy results, and download clean CSV summaries for archives. Generate polished PDFs and share concise, reproducible steps anywhere.

Enter Inputs

You can mix a single pair above with multiple pairs here.

Results

No results yet. Enter values and press Compute.

Example Data

Click “Use” to send values to the form.

amExpected inverse
3114
101712
15267

Formula Used

The modular inverse of a modulo m is an integer x such that:

a · x ≡ 1 (mod m)

  • Exists iff gcd(a, m) = 1.
  • Using the Extended Euclidean Algorithm, find integers x, y with a·x + m·y = gcd(a,m).
  • If the gcd is 1, then x mod m is the inverse.

We also reduce a modulo m first to simplify steps.

How to Use

  1. Enter integers for a and m (m > 1).
  2. Optionally paste multiple pairs in Batch input, one per line.
  3. Click Compute to get inverses and full Extended Euclid steps.
  4. Download a summary via Download CSV or a snapshot as PDF.
  5. Use examples to quickly test and verify understanding.

Tip: Negative a values are automatically reduced into the range [0, m).

FAQs

1) When does a modular inverse exist?

An inverse exists exactly when gcd(a, m) = 1. If the gcd is greater than 1, no inverse exists.

2) How are the steps generated?

They come from the Extended Euclidean Algorithm, showing quotients and the evolving remainders and coefficients.

3) What if a is negative or larger than m?

We reduce a modulo m so the computation is equivalent and cleaner.

4) Can I compute many inverses at once?

Yes. Paste multiple pairs in the batch area, one pair per line, and compute all together.

5) Why might the inverse show as “No inverse”?

Because gcd(a, m) ≠ 1. In that case, the congruence a·x ≡ 1 (mod m) has no solution.

Invertible Residues Count φ(m) for m = 2..20

The number of invertible classes modulo m equals Euler’s totient φ(m).

mφ(m)Notes
21All odd residues invertible
32
42
54
62
76Prime: φ(m)=m-1
84
96
104
1110Prime: φ(m)=m-1
124
1312Prime: φ(m)=m-1
146
158
168
1716Prime: φ(m)=m-1
186
1918Prime: φ(m)=m-1
208

Common Modular Inverse Pairs (Quick Reference)

Pairs (a, a⁻¹ mod m) shown for selected moduli. Symmetry: if a·b≡1 then b·a≡1.

m = 7

  • (1, 1)
  • (2, 4)
  • (3, 5)
  • (6, 6)

m = 11

  • (1, 1)
  • (2, 6)
  • (3, 4)
  • (5, 9)
  • (7, 8)
  • (10, 10)

m = 26

Coprime residues: 1,3,5,7,9,11,15,17,19,21,23,25.

  • (1, 1), (3, 9), (5, 21), (7, 15), (9, 3), (11, 19)
  • (15, 7), (17, 23), (19, 11), (21, 5), (23, 17), (25, 25)

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.