Math

Extended Euclidean Algorithm Calculator

Find integers x and y satisfying ax + by = gcd(a,b).

Exact method explained belowEditable inputs
Calculation notebook
Calculation notebook

The formula and worked example below explain the calculation.

See the method

Enter your values

Runs on your device

Your answer

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter integer a, integer b.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

The method, explained

Track the coefficients of each remainder in the Euclidean algorithm until the remainder becomes zero. The final nonzero remainder is the greatest common divisor.

A WORKED EXAMPLE

Using integer a = 240, integer b = 46, the result is 2. Change these example inputs to match your task; use the method above to check each step.

Understanding your result

Generally no. Adding b/g to x and subtracting a/g from y preserves the identity when g is the greatest common divisor.

What to keep in mind

Returns one pair of integer coefficients; infinitely many equivalent pairs may exist. Finite-precision arithmetic is used. Check the domain and the stated convention before using an approximation.

Common questions

Are Bézout coefficients unique?

Generally no. Adding b/g to x and subtracting a/g from y preserves the identity when g is the greatest common divisor.

How can I check the result?

Track the coefficients of each remainder in the Euclidean algorithm until the remainder becomes zero. The final nonzero remainder is the greatest common divisor. The worked example uses editable inputs. Calculations run on your device; no external API or account is required.

Methodology maintained by ClarityKit. How these tools are built and checked.