Euclidean Algorithm: How to Find the Greatest Common Divisor
The Euclidean algorithm finds the greatest common divisor of two numbers by repeatedly dividing them and replacing the larger number with the remainder until the remainder is zero.
Instead of listing out all the factors of both numbers, this algorithm uses a fast division process to narrow down the shared divisor step by step.

What Is Euclidean Algorithm?
The Euclidean algorithm is a famous mathematical method used to find the greatest common divisor (GCD) or greatest common factor (GCF) of two integers. It is also known as Euclid's algorithm or the Euclidean GCD algorithm.
The method is based on a simple principle: the greatest common divisor of two numbers also divides their difference. This means we can replace a large pair of numbers with a much smaller pair without changing the GCD.
By continually dividing the numbers and keeping only the remainder, we avoid having to list out all the factors manually. The last non-zero remainder in the sequence is the greatest common divisor.
When to Use It
The Euclidean algorithm is extremely useful when dealing with very large numbers. For small numbers, it is often easy to guess the GCD or list the factors. However, finding the prime factorization of large numbers using the fundamental theorem of arithmetic can be incredibly time-consuming.
This algorithm is the most efficient way to simplify fractions with large numerators and denominators. It is also the standard method used to check if two numbers are coprime numbers, meaning their GCD is exactly . Number theorists also use the algorithm in advanced proofs, including those related to prime factorization and perfect numbers.
Step-by-Step Method
To perform the Euclidean algorithm, you will use the standard division equation: .
- Identify the larger of your two numbers as the Dividend and the smaller as the Divisor.
- Divide the Dividend by the Divisor to find the Quotient and the Remainder.
- Shift the numbers for the next round: the old Divisor becomes the new Dividend, and the old Remainder becomes the new Divisor.
- Divide this new pair to find the next Remainder.
- Repeat this shifting and dividing process until the Remainder is exactly zero.
- The final non-zero Remainder before you reached zero is the greatest common divisor.

Visual Worked Examples
The algorithm works exactly the same whether you use small or large numbers. Writing the steps out as equations or organizing them into a table helps prevent calculation errors.
Example 1: Equation form
Question: What is the greatest common divisor of and ?
Method:
- Set up the first division: .
- Shift the numbers. Divide by the remainder : .
- Shift the numbers again. Divide by the remainder : .
- The remainder is now . The algorithm stops. The GCD is the previous non-zero remainder, which is .
Answer: The GCD is .
Check: Divide both numbers by . and . Since and share no common factors, is indeed the greatest common divisor.
Example 2: Tabular form with large numbers
Question: Find the GCD of and using a table.
Method:
- Create columns for the Dividend, Divisor, Quotient, and Remainder.
- Divide by to find the first row's values.
- Shift the Divisor and Remainder left into the next row.
- Continue dividing until you reach a Remainder of .

Answer: The greatest common divisor is .
Check: and . Because and have no common factors, the GCD is correct.
Example 3: Checking for coprime numbers
Question: Use the Euclidean algorithm to find the GCD of and .
Method:
- The last non-zero remainder is .
Answer: The GCD is . This confirms that and are coprime numbers.
Check: Since is a prime number and does not divide evenly into , their only shared factor is .
How to Check the Answer
To verify your result from the Euclidean algorithm, you must perform two simple division checks.
First, divide both of the original numbers by your final GCD.
They must both divide evenly with a remainder of zero. Second, examine the two quotients you just produced. If they share any common factor greater than , your algorithm calculation is incorrect, and your GCD is too small.
Common Mistakes
Choosing the quotient instead of the remainder
The most frequent mistake happens at the final step when the remainder hits zero. Students often look at the multiplier (the quotient) instead of the number being divided by (the divisor or previous remainder). The GCD is always the divisor that produced the zero remainder.
Not completing the final division
Some students stop the algorithm as soon as they see a small number, assuming they have reached the end. You must continue shifting and dividing until the remainder is exactly zero. The last non-zero remainder is your answer, even if it takes several more steps to prove it.
A learning plan shaped by your child, not the class
State-aligned Math plus our own Logic and English curriculum. An adaptive baseline test finds the gaps and fills them.
Practice questions

Based on the steps shown in the Euclidean algorithm table, what number belongs in the spaces with a question mark?
What is the greatest common divisor of and found using the Euclidean algorithm?

The diagram visually represents the Euclidean algorithm finding the GCD of and . What is the greatest common divisor?
When calculating the GCD of and , the final non-zero remainder in the Euclidean algorithm is . What does this reveal about the two numbers?
Both numbers are prime numbers.
The numbers are coprime and share no common factors other than .
A calculation error was made, as the remainder must be greater than .
The greatest common divisor is .
The numbers are coprime and share no common factors other than .
A student is finding the GCD of and . Their final steps are:
The student concludes that the GCD is . Why is this incorrect?
They stopped the algorithm one step too early.
They forgot to add the final remainder to the quotient.
The GCD should be the number they started with, which is .
They chose the quotient () instead of the divisor ().
They chose the quotient () instead of the divisor ().

