GCD Visualizer

HS + College

Formula

gcd(a,b)=gcd(b,amodb)\gcd(a, b) = \gcd(b, a \bmod b)

About

The Euclidean algorithm finds the greatest common divisor by repeatedly dividing and taking remainders. This geometric view shows the process as tiling a rectangle with squares — each step fits the largest possible square, and the final square size is the GCD.

Controls

gcd(48, 18) = 6
48 = 2 × 18 + 12
18 = 1 × 12 + 6
12 = 2 × 6 + 0