How this calculator works
An additive inverse makes a sum congruent to zero and always exists. A multiplicative inverse makes a product congruent to one; it exists only for coprime inputs. The extended Euclidean algorithm writes 1 as a combination of a and m, and the coefficient of a gives the inverse. Multiplicative mode displays this integer identity as a check. The answer is normalized between 0 and m - 1.
Formula
Additive: a + x ≡ 0 (mod m), so x = (-a) mod m. Multiplicative: ax ≡ 1 (mod m), requiring gcd(a,m) = 1.
Worked example
The multiplicative inverse of 3 modulo 11 is 4 because 3 × 4 = 12 = 11 + 1. The additive inverse of 3 modulo 11 is 8 because 3 + 8 = 11.
Advertisement
Frequently asked questions
Must the modulus be prime?
No. For example, 5 is its own inverse modulo 12 because 25 leaves remainder 1. Coprimality is the actual requirement.
Can a be negative?
Yes. -3 modulo 11 has multiplicative inverse 7 because -21 leaves remainder 1.
Why is modulus 1 excluded?
This tool uses the usual modular-inverse convention with m greater than 1, where the residue classes of zero and one are distinct.