Extended Euclidean algorithm calculator

Find the greatest common divisor and Bézout coefficients for signed integers.

Enter values

Start with the example below, or enter your own values.

How it works

Use the extended Euclidean recurrence to maintain a*x+b*y=gcd(a,b); at least one input must be nonzero.

Try an example

First integer: 240; Second integer: 46. The form starts with these values; change them to explore your own case.

Example result: 2

  1. Extended Euclidean recurrence.

Learn more in Exact number theory and congruences.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.