# How to find the greatest common divisor of two whole numbers

The greatest common divisor (GCF) of two whole numbers is the largest whole number that is a divisor (factor) of both. For example, the longest number dividing 20 and 16 is 4. In school, the “guess and check” method is commonly taught. Instead, this is a simple and systematic way to do this and always find the correct answer. This method is called "Euclid's algorithm". Let's call the two numbers "a" and "b".

## Steps

### Method 1 of 2: Use the Divider Algorithm

#### Step 2. Learn your vocabulary:

when you divide 32 by 5,

• 32 is the dividend
• 5 is the divisor
• 6 is the quotient
• 2 is the remainder.

#### Step 3. Identify the larger number of the two

That will be the dividend, and the smaller the divisor.

#### Step 4. Write this algorithm:

(dividend) = (divisor) * (quotient) + (remainder)

#### Step 12. Notice how 30 and 18 change position on the second line

Then 18 and 12 on the third line, and 12 and 6 on the fourth line. The 3, 1, 1, and 2 that follow after the multiplication symbol do not reappear. They represent how many times the divisor fits in the dividend, so they are unique on each line.

### Method 2 of 2: Use Prime Factors

#### Step 2. Find the prime factors of the numbers, and list them as shown below

• Using 24 and 18 as an example:

• 24- 2 x 2 x 2 x 3
• 18- 2 x 3 x 3
• Using 50 and 35 as an example:

• 50- 2 x 5 x 5
• 35- 5 x 7

#### Step 3. Identify all the common prime factors

• Using 24 and 18 as an example:

• 24-

Step 2. x 2 x 2

Step 3.

• 18-

#### Step 2

Step 3. x 3

• Using 50 and 35 as an example:

• 50- 2 x

Step 5. x 5

• 35-

Step 5. x 7

#### Step 4. Multiply the common factors together

• In the case of 24 and 18, multiply the

#### Step 2

Step 3. to get

Step 6.. The 6 is the greatest common factor of 24 and 18.

• In the case of 50 and 35, there is nothing to multiply.

Step 5. it is the only common factor, and therefore it is the largest.