Extended Euclidean Algorithm Calculator

Find the greatest common divisor of two whole numbers, along with the coefficients x and y that satisfy a × x + b × y = gcd(a, b). The calculator also shows the check so you can see the identity hold.

1 Fill in the boxes

2 Your answer

Your answer shows here as you type.

How to use the Extended Euclidean Algorithm Calculator

  1. Enter two whole numbers as a and b. Negative numbers are allowed.
  2. Read the GCD, which is always zero or positive.
  3. Read the coefficients x and y, then check that a × x + b × y equals the GCD.

Frequently asked questions

What does the extended Euclidean algorithm compute?

It finds the greatest common divisor (GCD) of two integers a and b, plus integers x and y such that a × x + b × y = gcd(a, b). This relationship is known as Bézout's identity.

How is it different from the regular Euclidean algorithm?

The regular algorithm only finds the GCD by repeated division with remainder. The extended version also tracks the coefficients x and y at each step, so it gives the identity without a separate back-substitution pass.

How is it used to find a modular inverse?

If gcd(a, m) = 1, the x produced for a and m is the inverse of a modulo m. Reduce x modulo m to get a value from 0 to m minus 1.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.