• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Matemática Básica
  • Elementary School
  • High School
  • Financial Math
  • Math Exercises
Home ❯ Modular Multiplicative Inverse Calculator

Modular Multiplicative Inverse Calculator – Free Online Tool

Calculate the modular multiplicative inverse (a · x ≡ 1 mod m) and the modular additive inverse (a + x ≡ 0 mod m) instantly. The calculator uses the extended Euclidean algorithm and displays the step-by-step solution with verification.

Modular Inverse Calculator

Inverse type
We are looking for x such that:
a · x = 1 mod m
a
m

Result

How to use the calculator

  1. Select the inverse type: Multiplicative or Additive.
  2. Enter the value of a (any integer).
  3. Enter the modulus m (integer ≥ 2).
  4. Click Calculate. The result shows the equation, the solution and the verification.

Modular multiplicative inverse

The modular multiplicative inverse of a with respect to modulus m is the integer x such that:

a · x ≡ 1 (mod m)

It exists only when gcd(a, m) = 1 (a and m are coprime). It is computed using the extended Euclidean algorithm, which finds integers x and y such that a·x + m·y = 1.

a m Inverse x Verification
2 3 2 2 · 2 = 4 ≡ 1 mod 3
3 7 5 3 · 5 = 15 ≡ 1 mod 7
5 11 9 5 · 9 = 45 ≡ 1 mod 11
7 13 2 7 · 2 = 14 ≡ 1 mod 13

Modular additive inverse

The modular additive inverse of a with respect to modulus m is the integer x such that:

a + x ≡ 0 (mod m)

It always exists and equals x = m − (a mod m) when a mod m ≠ 0, or x = 0 when a is a multiple of m.

a m Inverse x Verification
2 3 1 2 + 1 = 3 ≡ 0 mod 3
5 7 2 5 + 2 = 7 ≡ 0 mod 7
9 5 1 9 + 1 = 10 ≡ 0 mod 5
6 3 0 6 + 0 = 6 ≡ 0 mod 3

Frequently asked questions

What is the modular multiplicative inverse?

The modular multiplicative inverse of a with respect to modulus m is the value x such that a · x ≡ 1 (mod m). It exists only when gcd(a, m) = 1 and is computed using the extended Euclidean algorithm.

What is the modular additive inverse?

The modular additive inverse of a with respect to modulus m is x such that a + x ≡ 0 (mod m). It always exists: x = m − (a mod m) when a mod m ≠ 0; or x = 0 when a is a multiple of m.

When does the modular multiplicative inverse exist?

Only when gcd(a, m) = 1 — that is, when a and m share no common factor greater than 1. If gcd(a, m) > 1, the equation a·x ≡ 1 (mod m) has no solution.

How do you calculate the modular multiplicative inverse?

Use the extended Euclidean algorithm: find integers x and y such that a·x + m·y = gcd(a, m). If gcd = 1, then a·x ≡ 1 (mod m) and x (reduced to the range [0, m−1]) is the desired inverse.

See also…

  • Multiplicative Inverse Calculator
  • GCD Calculator
  • LCM Calculator
Jean Carlos Novaes

About Jean Carlos Novaes

I hold a degree in Computer Science from the Federal University of Bahia (2017) and am the editor and founder of this website.

Footer

Matemática Básica

Basic Mathematics website with school content and solved exercises for Elementary and High School. Learn in an easy and efficient way!

ABOUT

  • About Us
  • Contact
  • Sitemap

TOPICS

  • Elementary School
  • High School
  • Financial Math
  • Math Exercises

LEGAL

  • How to Cite
  • Cookie Policy
  • Privacy Policy
  • Content License

© 2015–2026 · Matemática Básica · All rights reserved.

We use cookies for site functionality, analytics and marketing, and to improve your experience.

Cookie preferences