Extended Euclidean Calculator
Enter two integers to find their GCD and Bezout coefficients (s, t) with a step-by-step extended Euclidean algorithm table.
Inputs
gcd(a, b)
Coefficient s
Coefficient t
Step-by-Step Table
Enter values and click Calculate to see the steps.
| Step | Dividend | Divisor | Quotient | Remainder | s | t |
|---|
Each row: dividend = quotient × divisor + remainder. Columns s and t track the Bezout coefficients via back-substitution.
How to read the table
- Each row performs one division step: dividend = quotient × divisor + remainder.
- The s and t columns are updated as: s_new = s_prev − quotient × s_curr (same for t).
- The last non-zero remainder is the GCD. The s and t values in that row are the Bezout coefficients.
- Highlighted row is the final step where the remainder reaches zero.
Summary
Enter two integers to find their GCD and Bezout coefficients (s, t) with a step-by-step extended Euclidean algorithm table.
How it works
- Enter two integers a and b in the input fields.
- Click Calculate to run the extended Euclidean algorithm.
- The step-by-step table shows each division, quotient, and coefficient update.
- Read the GCD and Bezout coefficients s, t from the final result row.
- Verify: a·s + b·t should equal the GCD shown.
Use cases
- Find the modular inverse of a number (when gcd = 1, s is the inverse of a mod b).
- Solve linear Diophantine equations of the form a·x + b·y = c.
- Check whether two integers are coprime (GCD = 1).
- Cryptography coursework — RSA key generation requires extended GCD.
- Number theory homework — verify Bezout identity by hand.
- Competitive programming — precompute modular inverses quickly.
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu