🎉 Launch offer — save 30% on every plan, locked in for early families. See plans →

Euclidean Algorithm: Guide and Examples

MathPublished

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.

A rectangle of width 30 and height 12 is divided into two 12 by 12 squares and two 6 by 6 squares. The smallest square size is 6, which is the GCD of 30 and 12.

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 11. 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: Dividend=Divisor×Quotient+Remainder\text{Dividend} = \text{Divisor} \times \text{Quotient} + \text{Remainder}.

  1. Identify the larger of your two numbers as the Dividend and the smaller as the Divisor.
  2. Divide the Dividend by the Divisor to find the Quotient and the Remainder.
  3. Shift the numbers for the next round: the old Divisor becomes the new Dividend, and the old Remainder becomes the new Divisor.
  4. Divide this new pair to find the next Remainder.
  5. Repeat this shifting and dividing process until the Remainder is exactly zero.
  6. The final non-zero Remainder before you reached zero is the greatest common divisor.
A diagram showing the shifting process of the Euclidean algorithm. 252 equals 105 times 2 plus 42. The 105 shifts left to become the new dividend, and the 42 shifts left to become the new divisor in the next equation: 105 equals 42 times 2 plus 21.
A parent reviewing their child's subject progress on a laptop
FOR PARENTS

See exactly where your child is strong — and where not

Chapter-by-chapter progress, mastery scores and lesson reports. Request custom worksheets from an academic counsellor.

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 252252 and 105105?

Method:

  1. Set up the first division: 252=105×2+42252 = 105 \times 2 + 42.
  2. Shift the numbers. Divide 105105 by the remainder 4242: 105=42×2+21105 = 42 \times 2 + 21.
  3. Shift the numbers again. Divide 4242 by the remainder 2121: 42=21×2+042 = 21 \times 2 + 0.
  4. The remainder is now 00. The algorithm stops. The GCD is the previous non-zero remainder, which is 2121.

Answer: The GCD is 2121.

Check: Divide both numbers by 2121. 252÷21=12252 \div 21 = 12 and 105÷21=5105 \div 21 = 5. Since 1212 and 55 share no common factors, 2121 is indeed the greatest common divisor.


Example 2: Tabular form with large numbers


Question: Find the GCD of 10711071 and 462462 using a table.

Method:

  1. Create columns for the Dividend, Divisor, Quotient, and Remainder.
  2. Divide 10711071 by 462462 to find the first row's values.
  3. Shift the Divisor and Remainder left into the next row.
  4. Continue dividing until you reach a Remainder of 00.
A four-column table for the Euclidean algorithm. Row 1: 1071, 462, 2, 147. Row 2: 462, 147, 3, 21. Row 3: 147, 21, 7, 0. The number 21 in the divisor column of the final row is highlighted in yellow as the GCD.

Answer: The greatest common divisor is 2121.

Check: 1071÷21=511071 \div 21 = 51 and 462÷21=22462 \div 21 = 22. Because 5151 and 2222 have no common factors, the GCD is correct.


Example 3: Checking for coprime numbers


Question: Use the Euclidean algorithm to find the GCD of 100100 and 2323.

Method:

  1. 100=23×4+8100 = 23 \times 4 + 8
  2. 23=8×2+723 = 8 \times 2 + 7
  3. 8=7×1+18 = 7 \times 1 + 1
  4. 7=1×7+07 = 1 \times 7 + 0
  5. The last non-zero remainder is 11.

Answer: The GCD is 11. This confirms that 100100 and 2323 are coprime numbers.

Check: Since 2323 is a prime number and does not divide evenly into 100100, their only shared factor is 11.

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 11, 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.

BUILT AROUND YOUR CHILD

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

Question

A partially completed Euclidean algorithm table. Row 1: Dividend 144, Divisor 55, Quotient 2, Remainder 34. Row 2: Dividend 55, Divisor 34, Quotient 1, Remainder is a question mark. Row 3: Dividend 34, Divisor ?, Quotient 1, Remainder 13.


Based on the steps shown in the Euclidean algorithm table, what number belongs in the spaces with a question mark?

  • 1313

  • 2121

  • 3434

  • 5555

Answer:

2121

Question

What is the greatest common divisor of 6060 and 2424 found using the Euclidean algorithm?

  • 66

  • 1212

  • 2424

  • 22

Answer:

1212

Question

A rectangle of width 21 and height 15 is divided into one 15 by 15 square on the left, leaving a 6 by 15 rectangle on the right. This right rectangle is divided into two 6 by 6 squares and one 6 by 3 rectangle. The 6 by 3 rectangle is divided into two 3 by 3 squares.


The diagram visually represents the Euclidean algorithm finding the GCD of 2121 and 1515. What is the greatest common divisor?

  • 1515

  • 66

  • 33

  • 22

Answer:

33

Question

When calculating the GCD of 715715 and 312312, the final non-zero remainder in the Euclidean algorithm is 11. What does this reveal about the two numbers?

  • Both numbers are prime numbers.

  • The numbers are coprime and share no common factors other than 11.

  • A calculation error was made, as the remainder must be greater than 11.

  • The greatest common divisor is 00.

Answer:

The numbers are coprime and share no common factors other than 11.

Question

A student is finding the GCD of 312312 and 7070. Their final steps are:

32=6×5+232 = 6 \times 5 + 2

6=2×3+06 = 2 \times 3 + 0

The student concludes that the GCD is 33. 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 3232.

  • They chose the quotient (33) instead of the divisor (22).

Answer:

They chose the quotient (33) instead of the divisor (22).

Early access

Join the COPRIMES waitlist

Tell us a little about your child. We'll email you when your spot opens, and early families lock in launch pricing.

Early-access emails only. Unsubscribe anytime.