Home · Everyday · Bases, Binary & Logic · Inverse Modulo Calculator

Inverse Modulo Calculator

The modular inverse of a modulo m — the number whose product with a is 1 mod m — by extended Euclid.

Your figures

Example result — edit the figures to make it yours

4

Inverse of 3 mod 11

The inverse is the number x with a·x ≡ 1 (mod m), found by the extended Euclidean algorithm (Bézout's identity).

Check: a × x mod m1
Bézout combination3 × (4) + 11 × (-1) = 1

What this calculator does

The modular inverse of a modulo m — the number whose product with a is 1 mod m — by extended Euclid. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.

The formula and method

Bézout: ax + my = gcd(a, m) = 1 gives x = a⁻¹ mod m

The inverse of a modulo m exists exactly when gcd(a, m) = 1.

It is found with the extended Euclidean algorithm.

The result is the least positive residue.

Worked example

With the example inputs this page opens with (a 3, modulus m 11), the result is 4 — inverse of 3 mod 11. The inverse is the number x with a·x ≡ 1 (mod m), found by the extended Euclidean algorithm (Bézout's identity).

Quick reference

Quick reference — varying a
aInverse of 3 mod 11
1.56
2.46
34
3.753
4.59
62

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the Inverse Modulo Calculator work?

The modular inverse of a modulo m — the number whose product with a is 1 mod m — by extended Euclid. A · m → Inverse. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Inverse Modulo Calculator need?

A · m → Inverse. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the Inverse Modulo Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.