Download ArticleDownload Article

The Greatest Common Divisor (GCD) of two whole numbers, also called the Greatest Common Factor (GCF) and the Highest Common Factor (HCF), is the largest whole number that's a divisor (factor) of both of them. For instance, the largest number that divides into both 20 and 16 is 4. (Both 16 and 20 have larger factors, but no larger common factors -- for instance, 8 is a factor of 16, but it's not a factor of 20.) In grade school, most people are taught a "guess-and-check" method of finding the GCD. Instead, there is a simple and systematic way of doing this that always leads to the correct answer. The method is called "Euclid's algorithm." If you want to know how to truly find the Greatest Common Divisor of two integers, see Step 1 to get started.[1]

Method 1
Method 1 of 2:

Using the Divisor Algorithm

Download Article
  1. How.com.vn English: Step 1 Drop any negative signs.
  2. How.com.vn English: Step 2 Know your vocabulary:
    when you divide 32 by 5,[2]
      • 32 is the dividend
      • 5 is the divisor
      • 6 is the quotient
      • 2 is the remainder (or modulo).
    Advertisement
  3. How.com.vn English: Step 3 Identify the larger of the two numbers.
    That will be the dividend, and the smaller the divisor.[3]
  4. How.com.vn English: Step 4 Write out this algorithm:
    (dividend) = (divisor) * (quotient) + (remainder)[4]
  5. How.com.vn English: Step 5 Put the larger number in the spot for dividend, and the smaller number as the divisor.
    [5]
  6. How.com.vn English: Step 6 Decide how many times the smaller number will divide into the larger number, and drop it into the algorithm as the quotient.
  7. How.com.vn English: Step 7 Calculate the remainder, and substitute it into the appropriate place in the algorithm.
    [6]
  8. How.com.vn English: Step 8 Write out the...
    Write out the algorithm again, but this time A) use the old divisor as the new dividend and B) use the remainder as the new divisor.
  9. How.com.vn English: Step 9 Repeat the previous step until the remainder is zero.
  10. How.com.vn English: Step 10 The last divisor is the greatest common divisor.
  11. How.com.vn English: Step 11 Here is an example, where we are trying to find the GCD of 108 and 30:
  12. How.com.vn English: Step 12 Notice how the 30 and the 18 in the first line shift positions to create the second line.
    Then, the 18 and 12 shift to create the third line, and the 12 and 6 shift to create the fourth line. The 3, 1, 1, and 2 that follow the multiplication symbol do not reappear. They represent how many times the divisor goes into the dividend, so they are unique to each line.
  13. Advertisement
Method 2
Method 2 of 2:

Using Prime Factors

Download Article
  1. How.com.vn English: Step 1 Drop any negative signs.
    [7]
  2. How.com.vn English: Step 2 Find the prime...
    Find the prime factorization of the numbers, and list them out as shown.[8]
    • Using 24 and 18 as the example numbers:
      • 24- 2 x 2 x 2 x 3
      • 18- 2 x 3 x 3
    • Using 50 and 35 as the example numbers:
      • 50- 2 x 5 x 5
      • 35- 5 x 7
  3. How.com.vn English: Step 3 Identify all common prime factors.
    • Using 24 and 18 as the example numbers:
      • 24- 2 x 2 x 2 x 3
      • 18- 2 x 3 x 3
    • Using 50 and 35 as the example numbers:
      • 50- 2 x 5 x 5
      • 35- 5 x 7
  4. How.com.vn English: Step 4 Multiply...
    Multiply the common factors together.[9]
    • In the case of 24 and 18, multiply 2 and 3 together to get 6. Six is the greatest common factor of 24 and 18.
    • In the case of 50 and 35, there is nothing to multiply. 5 is the only common factor, and therefore the greatest.
  5. How.com.vn English: Step 5 Finished.
  6. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I find the gcd of three integers?
    How.com.vn English: Donagan
    Donagan
    Top Answerer
    Find all of the divisors of each of the integers, and note the largest one that's common to all three.
  • Question
    How do I round off 93,678,563 to the nearest 10,000?
    How.com.vn English: Donagan
    Donagan
    Top Answerer
    Look at the digit in the 1,000's place: it's 8, so you round up to 93,680,000.
  • Question
    What is a multiplicative inverse?
    How.com.vn English: Donagan
    Donagan
    Top Answerer
    A multiplicative inverse is the reciprocal of a number.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      • One way to write this, using the notation <dividend> mod <divisor> = the remainder is that GCD(a,b) = b if a mod b = 0, and GCD(a,b) = GCD(b, a mod b) otherwise.
      • As an example, let's find GCD(-77,91). First, use 77 instead of -77, so GCD(-77,91) becomes GCD(77,91). Now, 77 is less than 91, so we should swap them, but let's see how the algorithm takes care of that if we don't. When we calculate 77 mod 91, we get 77 (since 77 = 91 x 0 + 77). Since that's not zero, we switch (a, b) for (b, a mod b) and that gives us: GCD(77,91) = GCD(91,77). 91 mod 77 gives 14 (remember, that means 14 is the remainder). Since that's not zero, swap GCD(91,77) for GCD(77,14). 77 mod 14 gives 7 which is not zero, so swap GCD(77,14) for GCD(14,7). 14 mod 7 is zero, since 14 = 7 * 2 with no remainder, so we stop. And that means: GCD(-77,91) = 7.
      • This technique is very useful when reducing fractions. By the above example, the fraction -77/91 reduces to -11/13 because 7 is the greatest common divisor of -77 and 91.
      Show More Tips
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 40 people, some anonymous, worked to edit and improve it over time. This article has been viewed 611,390 times.
      66 votes - 74%
      Co-authors: 40
      Updated: July 29, 2019
      Views: 611,390
      Thanks to all authors for creating a page that has been read 611,390 times.

      Did this article help you?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement