Euclidean Algorithm Steps
Enter two integers and see every step of the Euclidean algorithm — division, remainder, and the final GCD.
Enter Two Integers
Quick examples
Division Steps
| Step | Equation | Dividend | Divisor | Quotient | Remainder |
|---|
Back-substitution (Extended Algorithm)
Expresses GCD as a linear combination: a·x + b·y = GCD
| Step | x coefficient | y coefficient | Value |
|---|
Enter two integers above and click Compute.
Summary
Enter two integers and see every step of the Euclidean algorithm — division, remainder, and the final GCD.
How it works
- Enter two integers (positive or negative) in the input fields.
- The tool applies the Euclidean algorithm: repeatedly replace (a, b) with (b, a mod b) until b = 0.
- Each iteration is shown as a row: a = q × b + r.
- The last non-zero remainder is the GCD.
- Enable "Extended algorithm" to back-substitute and find Bezout coefficients x, y such that ax + by = GCD.
Use cases
- Check Euclidean algorithm homework step by step.
- Verify the GCD before simplifying a fraction.
- Learn how the algorithm reduces large numbers to small ones quickly.
- Use Bezout coefficients to solve linear Diophantine equations.
- Confirm coprimeness: GCD = 1 means the numbers share no factors.
- Understand why the algorithm terminates in O(log min(a,b)) steps.
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu