What is a multiplicative inverse?
The multiplicative inverse of a number is the value you multiply it by to get 1. For an ordinary real number a, that inverse is simply the reciprocal \(1/a\) — for example, the inverse of 4 is 0.25 because \(4 \times 0.25 = 1\). Zero has no inverse because no number times zero equals one.
$$a^{-1} = \frac{1}{\text{Number (a)}}$$
Modular inverse
In modular arithmetic, the multiplicative inverse of a (mod m) is the integer x in the range 0 to m−1 such that \(a \cdot x \equiv 1 \pmod{m}\). This appears constantly in number theory and cryptography (RSA, hashing, error-correcting codes). A modular inverse exists only when a and m are coprime — that is, \(\gcd(a, m) = 1\). This calculator finds it with the extended Euclidean algorithm.
$$\text{Number (a)} \cdot a^{-1} \equiv 1 \pmod{\text{Modulus (m)}}$$
How to use this calculator
Enter your number a. Leave the modulus at 0 (or blank) to get the plain reciprocal \(1/a\). To compute a modular inverse, enter a modulus m greater than 1; the calculator reduces a modulo m and returns the inverse, or tells you none exists if a and m share a common factor.
Worked example
Find the inverse of 3 modulo 11. We need x with \(3x \equiv 1 \pmod{11}\). Testing \(x = 4\) gives $$3 \times 4 = 12 = 11 + 1 \equiv 1 \pmod{11}.$$ So the modular inverse is 4. As a reciprocal, the inverse of 3 is \(1/3 \approx 0.333333\).
FAQ
Why does zero have no inverse? Because any number multiplied by 0 is 0, never 1.
When does a modular inverse fail to exist? When \(\gcd(a, m) \neq 1\) — for instance, 4 has no inverse mod 8 since they share the factor 4.
Can I use a negative number for modular inverse? Yes; it is first reduced into the range 0 to m−1 before inverting.