AlgoScope

Greatest Common Divisor

MathematicsbeginnerNumber Theoryalso called GCD

The largest number that divides both. Euclid finds it in O(log n) steps.

Result · step 2 of 5Number Theory Basics: gcd(48, 18) by Euclid
480181122i

48 mod 18 = 12. Any divisor of 48 and 18 divides 12 too, so the pair becomes (18, 12).

Open in the player →or start at step 2

What you will see

Two bars; the GCD is the largest unit that tiles both exactly.

How number theory basics works →

Cost

SpaceO(1)

How you work with it here

play it through, step one change at a time, run it on your own input.

Screen readers: Numbers announce their value and role; each step announces the arithmetic performed.

Reduced motion: Values crossfade; no travelling digits.

Leads to

Topics that need this one first.

Taught by the same lesson

Number Theory Basics covers these too, in the same run.