CalcWorldHub
Free online calculator · no signup

Extended Euclidean algorithm calculator

Find the greatest common divisor of two integers together with Bézout coefficients that express that divisor as their integer combination.

Extended Euclidean algorithm calculator — Integer a, Integer b and calculation method
Extended Euclidean algorithm calculator: inputs and calculation method.

How to use this calculator

Find the greatest common divisor of two integers together with Bézout coefficients that express that divisor as their integer combination.

  1. Enter Integer a, Integer b. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

How Extended Euclidean algorithm calculator works

Find the greatest common divisor of two integers together with Bézout coefficients that express that divisor as their integer combination.

Inputs and units

  • Integer a: First signed integer a in the Bézout identity.
  • Integer b: Second signed integer b in the Bézout identity.

Formula and method

a·x + b·y = gcd(a,b)

Worked example

For a=30 and b=18, 30(−1)+18(2)=6, so gcd(30,18)=6 with coefficients x=−1 and y=2.

Interpreting the result

The gcd is nonnegative; the signed coefficients vary by algorithm convention, but their identity must hold exactly for the entered integers.

Assumptions and limits

Both inputs must be integers. If one input is zero, the gcd is the absolute value of the other; if both are zero, gcd is not uniquely defined by the usual positive-gcd convention.

Frequently asked questions

Can the Bézout coefficients be negative?

Yes. Their signs depend on the inputs; the required check is a·x+b·y=gcd(a,b).

Is gcd(0,0) defined?

The usual positive-gcd convention leaves gcd(0,0) undefined, so it should be treated as a special case.

How do I use the Extended Euclidean algorithm calculator?

Enter Integer a, Integer b. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Extended Euclidean algorithm?

For a=30 and b=18, 30(−1)+18(2)=6, so gcd(30,18)=6 with coefficients x=−1 and y=2.

What does the Extended Euclidean algorithm calculator calculate?

Find the greatest common divisor of two integers together with Bézout coefficients that express that divisor as their integer combination.

Related calculators