If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Greatest common factor examples

The greatest common factor (GCF) of a set of numbers is the largest factor that all the numbers share. For example, 12, 20, and 24 have two common factors: 2 and 4. The largest is 4, so we say that the GCF of 12, 20, and 24 is 4. GCF is often used to find common denominators. Created by Sal Khan.

Want to join the conversation?

  • starky sapling style avatar for user Kenneth Nguyen
    Why does multiplying the common prime factors work to show the greatest common divisor? How come there is no greater number besides the answer?
    (59 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user Michaelr.Renaud
    The GCF (or GCD) is very useful in simplifying complex math problems when you move on to more advanced material. Sometimes, it can make the difference between being able to solve the problem and not being able to solve them.

    For this level of math, it helps you reduce fractions to their simplest form, thus helping you to better understand the numbers involved. For example, would you realize, without simplifying that 226/791 is the same thing as 2/7?

    so if you are dealing with fractions... also this is the base of many other (used in life) advanced math problems.

    so fractions and it is the basis of many other advanced math problems you will use more in life.
    (33 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user Michaelr.Renaud
    Yes, there is the difference between GCF and GCD is that GCF is the greatest common factor and GCD is the greatest common denominator. A factor is a number or quantity that when multiplied with another produces a given number or expression. A denominator is the number below the line in a common fraction; a divisor.
    I hope this helps!:)
    (32 votes)
    Default Khan Academy avatar avatar for user
  • boggle green style avatar for user potatopogg
    can't you just think of 7 as a prime number and apply the gcd as 1? is 1 the only factor other than the number itself for every prime number? does prime factorization work for every gcd?
    (9 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      Prime definition is whole number which is not divisible by any other whole number except itself and 1, so yes to the second question. 1st question is yes as long as the other number is not a factor of 7. and yes prime factorization will always work to see what is common between two numbers.
      It helps to learn divisibility rules
      All even numbers (except 2) has 2 as a factor
      If the last two digits (tens and ones) are divisible by 4, whole number is divisible by 4 (or divide by 2 twice)
      If the last 3 digits (hundreds, tens and ones) are divisible by 8, whole number is divisible by 8 (or 2 three times).
      If the sum of the digits add up to a factor of 3, it is divisible by 3, and same thing if add up to 9, divisible by 9 (or 3 twice)
      6 is a combo of 2 and 3.
      If the ones digit is 5 or 0, it is divisible by 5.
      With any zeroes on end, you have equal number of 5s and 2s
      This covers all numbers up to 10 except 7.
      (13 votes)
  • duskpin sapling style avatar for user 🌟Starz 🌟
    Because a lot of people do not get it, I will expand apon the idea.

    GCF is saying that what number can go into __ and ___ ?

    For example, let’s take 24 and 36


    So we write out the factors:

    24: 1,2,12,24
    36:1,3,12,36

    Now we find what they both have in common? Try and figure it out yourself.




    Did you get it? It’s 12. So 12 is our GCF or GCD
    (10 votes)
    Default Khan Academy avatar avatar for user
  • duskpin sapling style avatar for user TheParrots
    Is the greatest common divisor another name for the greatest common factor??
    (6 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Maanya💙
    Around why did Sal chose 3 over the 2? Two is the smallest number that goes into 21.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • duskpin ultimate style avatar for user Sage
    Are GCF (greatest common factor) and GCD (greatest common divisor) the same thing?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • starky tree style avatar for user Brecken#8
    they should put the grade level next to the link so you know your on the right grade level.Because I'm in 4th grade and this is 6th.
    (6 votes)
    Default Khan Academy avatar avatar for user
  • leafers ultimate style avatar for user 🌱PLANTER
    is there actually a prime number? because 7 is 3.5 X 2
    1,3.5,7
    (4 votes)
    Default Khan Academy avatar avatar for user

Video transcript

We're asked, what is the greatest common divisor of 20 and 40? And they just say, another way to say this is the GCD, or greatest common divisor, of 20 of 40 is equal to question mark. And greatest common divisor sounds like a very fancy term, but it's really just saying, what is the largest number that is divisible into both 20 and 40? Well, this seems like a pretty straightforward situation, because 20 is actually divisible into 40. Or another way to say it is 40 can be divided by 20 without a remainder. So the largest number that is a-- I guess you could say-- factor of both 20 and 40 is actually 20. 20 is 20 times 1, and 40 is 20 times 2. So in this situation, we don't even have to break out our paper. We can just write 20. Let's do a couple more of these. So we're asked, what is the greatest common divisor of 10 and 7? So let's now break out our paper for this. So our greatest common divisor of 10 and 7. So let me write that down. So we have 10. We want to think about what is our GCD of 10 and 7? And there's two ways that you can approach this. One way, you could literally list all of the factors-- not prime factors, just regular factors-- of each of these numbers and figure out which one is greater or what is the largest factor of both. So, for example, you could say, well, I got a 10, and 10 can be expressed 1 times 10 or 2 times 5. 1, 2, 5, and 10. These are all factors of 10. These are all, we could say, divisors of 10. And sometimes this is called greatest common factor. Seven-- what are all of its factors? Well, 7 is prime. It only has two factors-- 1 and itself. So what is the greatest common factor? Well, there's only one common factor here, 1. 1 is the only common factor. So the greatest common factor of 10 and 7, or the greatest common divisor, is going to be equal to 1. So let's write that down. 1. Let's do one more. What is the greatest common divisor of 21 and 30? And this is just another way of saying that. So 21 and 30 are the two numbers that we care about. So we want to figure out the greatest common divisor, and I could have written greatest common factor, of 21 and 30. So once again, there's two ways of doing this. And so there's the way I did the last time where I literally list all the factors. Let me do it that way really fast. So if I say 21, what are all the factors? Well, it's 1 and 21, and 3, and 7. I think I've got all of them. And 30 can be written as 1 and 30, 2 and 15, and 3-- actually, I'm going to run out of them. Let me write it this way so I get a little more space. So 1 and 30. 2 and 15. 3 and 10. And 5 and 6. So here are all of the factors of 30. And now what are the common factors? Well, 1 is a common factor. 3 is also a common factor. But what is the greatest common factor or the greatest common divisor? Well, it is going to be 3. So we could write 3 here. Now, I keep talking about another technique. Let me show you the other technique, and that involves the prime factorization. So if you say the prime factorization of 21-- well, let's see, it's divisible by 3. It is 3 times 7. And the prime factorization of 30 is equal to 3 times 10, and 10 is 2 times 5. So what are the most factors that we can take from both 21 and 30 to make the largest possible numbers? So when you look at the prime factorization, the only thing that's common right over here is a 3. And so we would say that the greatest common factor or the greatest common divisor of 21 and 30 is 3. If you saw nothing in common right over here, then you say the greatest common divisor is one. Let me give you another interesting example, just so that we can get a sense of things. So let's say these two numbers were not 21 and 30, but let's say we care about the greatest common divisor not of 21, but let's say of 105 and 30. So if we did the prime factorization method, it might become a little clearer now. Actually figuring out, hey, what are all the factors of 105 might be a little bit of a pain, but if you do a prime factorization, you'd say, well, let's see, 105-- it's divisible by 5, definitely. So it's 5 times 21, and 21 is 3 times 7. So the prime factorization of 105 is equal to-- if I write them in increasing order-- 3 times 5 times 7. The prime factorization of 30, we already figured out is 30 is equal to 2 times 3 times 5. So what's the most number of factors or prime factors that they have in common? Well, these two both have a 3, and they both have a 5. So the greatest common factor or greatest common divisor is going to be a product of these two. In this situation, the GCD of 105 and 30 is 3 times 5, is equal to 15. So you could do it either way. You could just list out the traditional divisors or factors and, say, figure out which of those is common and is the greatest. Or you can break it down into its core constituencies, its prime factors, and then figure out what is the largest set of common prime factors, and the product of those is going to be your greatest common factor. It's the largest number that is divisible into both numbers.