Tested tool guide
Tested browser tools
Checked August 16, 2026
What Euclidean Algorithm Visualizer does, with a checked example
The Euclidean Algorithm Visualizer takes two integers and runs the repeated-division process from Euclid's Elements: divide, keep the remainder, repeat, and the last nonzero remainder is the greatest common divisor (GCD). Each step is drawn as squares filling a rectangle of the two inputs, so the GCD appears as the largest square that tiles it exactly. An extended run also returns Bezout coefficients x and y with ax + by = gcd(a,b). What surprises people: the GCD is not the product of common prime factors you would spot by inspection. The process is purely mechanical, works for any pair, and the Bezout identity is a byproduct of the same steps.
Worked example
A concrete input and expected output from the current implementation.
->
Expected output
GCD: 21
Steps:
252 = 2 x 105 + 42
105 = 2 x 42 + 21
42 = 2 x 21 + 0
Bezout identity: 21 = -2 x 252 + 5 x 105
21 is the last nonzero remainder, so it is the GCD. Back-substituting the remainders rewrites 21 as -2(252) + 5(105), and -504 + 525 = 21 verifies the Bezout identity.