What Is the Euclidean Algorithm?
The Euclidean algorithm finds the greatest common factor of two numbers using only division with remainder. It is one of the oldest algorithms still in use, and it works on huge numbers without any factoring.
How to Use This Euclidean Algorithm Calculator
- Type two whole numbers into the boxes.
- Press Calculate to see every division step, the GCF and the LCM.
How the Euclidean Algorithm Works
- Divide the larger number by the smaller one and note the remainder.
- Replace the larger number with the smaller, and the smaller with the remainder.
- Repeat until the remainder is 0.
- The last non-zero remainder is the GCF.

Why It Works
Any number that divides both a and b also divides the remainder of a ÷ b. So the pair (a, b) has the same GCF as the smaller pair (b, remainder). The numbers shrink each step until the remainder reaches 0.
From the GCF to the LCM
Once you have the GCF, the LCM is the product of the two numbers divided by the GCF. For 252 and 105 the GCF is 21, so the LCM is 252 × 105 ÷ 21 = 1,260.

Worked Examples
- Euclidean algorithm for 1,071 and 462 : GCF 21
- Euclidean algorithm for 252 and 105 : GCF 21
- Euclidean algorithm for 48 and 18 : GCF 6
- Euclidean algorithm for 270 and 192 : GCF 6
Common mistakes
- Stopping at the zero. The GCF is the remainder before the 0, not the 0 itself.
- Mixing up the quotient and the remainder. Only the remainder carries into the next step.
- Dividing the smaller by the larger first. That just swaps the numbers and wastes a step.