Greatest Common Factor (GCF)
The greatest common factor is the largest number that divides two or more numbers exactly. Learn to find it by listing factors, by prime factorization and with the Euclidean algorithm, how it relates to the LCM, and how it helps you simplify fractions and solve word problems.
The greatest common factor (GCF) of two or more whole numbers is the largest number that divides all of them without a remainder. The GCF of 12 and 18 is 6: the factors of 12 are 1, 2, 3, 4, 6, 12, the factors of 18 are 1, 2, 3, 6, 9, 18, and 6 is the largest number on both lists. The GCF is also called the greatest common divisor (GCD) and, in the UK, the highest common factor (HCF). All three names mean the same number.
What is the greatest common factor?
A factor (or divisor) of a number divides it exactly: 6 is a factor of 18 because 18 ÷ 6 = 3 with no remainder. Factors come in pairs whose product is the number: 18 = 1 × 18 = 2 × 9 = 3 × 6. A common factor of two numbers divides both, and the greatest of these is the GCF. It can never be larger than the smallest of the numbers, and 1 is always a common factor.
Method 1: listing factors
- List all factors of each number. Work in pairs: start with 1 and the number itself, then test 2, 3, 4 and so on until the pairs meet.
- Circle the factors that appear on every list.
- The largest circled factor is the GCF.
Method 2: prime factorization
- Write each number as a product of primes, with exponents for repeated factors.
- Keep only the primes that appear in every number.
- For each of them, take the lowest power that appears.
- Multiply these powers. If no prime is shared, the GCF is 1.
The same factorizations give the least common multiple if you take every prime with its highest power instead, as explained on least common multiple.
The ladder method
Divide both numbers by a common prime, write the quotients below, and repeat until the bottom numbers share no factor. The GCF is the product of the primes on the left.
| Divide by | First number | Second number |
|---|---|---|
| 2 | 48 | 180 |
| 2 | 24 | 90 |
| 3 | 12 | 45 |
| bottom row | 4 | 15 |
4 and 15 share no factor, so GCF = 2 × 2 × 3 = 12.
Method 3: the Euclidean algorithm
For large numbers, factoring is slow. The Euclidean algorithm needs only division with remainder:
- Divide the larger number by the smaller one and note the remainder.
- Replace the larger number with the smaller one, and the smaller number with the remainder.
- Repeat until the remainder is 0.
- The last remainder that was not 0 (the last divisor) is the GCF.
| Division | Quotient | Remainder |
|---|---|---|
| 1,071 ÷ 462 | 2 | 147 |
| 462 ÷ 147 | 3 | 21 |
| 147 ÷ 21 | 7 | 0 |
So GCF(1,071, 462) = 21, found in three divisions without factoring either number. It works because any number that divides both a and b also divides the remainder of a ÷ b, so the pairs (1,071, 462), (462, 147), (147, 21) all have the same GCF, and the last pair makes it obvious.
GCF of 3 numbers
With prime factorization, keep the primes shared by all three numbers. Or find the GCF of two of them and then the GCF of that result and the third number: GCF(a, b, c) = GCF(GCF(a, b), c).
GCF × LCM = a × b
For two numbers, the GCF and the least common multiple are linked by a simple rule: their product equals the product of the two numbers. For 12 and 18: GCF = 6, LCM = 36, and 6 × 36 = 216 = 12 × 18. So once you know the GCF, the LCM is one division away: LCM(a, b) = a × b ÷ GCF(a, b). The rule holds for two numbers only, not for three or more.
Simplifying fractions with the GCF
Dividing the numerator and the denominator by their GCF puts a fraction in simplest form in one step. For 48/180, GCF(48, 180) = 12, so 48/180 = 4/15. See simplifying fractions for more.
GCF word problems
A problem needs the GCF when you split things into the largest possible equal groups with nothing left over, or look for the biggest size that fits several lengths exactly.
Common mistakes
- Mixing up GCF and LCM. The GCF is never larger than the smallest number; the LCM is never smaller than the largest.
- Taking the highest powers or primes that are not shared. For 48 and 180, the 5 does not belong in the GCF.
- Missing factors when listing. Work in pairs (1 × 36, 2 × 18, 3 × 12, …) so that none slips through.
- Stopping the Euclidean algorithm too early or giving the last remainder 0 as the answer. The GCF is the last nonzero remainder.
- Saying the GCF of coprime numbers is 0. It is 1, since 1 divides every number.
Practice problems
- GCF of 16 and 24 (list the factors)
- GCF of 27 and 45
- GCF of 14 and 25
- GCF of 60 and 84 (use prime factorization)
- GCF of 90 and 126
- GCF of 120 and 84 (use the Euclidean algorithm)
- GCF of 391 and 299 (use the Euclidean algorithm)
- GCF of 18, 30 and 42
- Simplify 84/126 with the GCF.
- Use the GCF to find the LCM of 20 and 30.
- 40 pencils and 56 erasers are packed into identical kits with nothing left over. What is the greatest number of kits, and what is in each?
Show answers
- Factors of 16: 1, 2, 4, 8, 16. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. GCF = 8.
- 27 = 3³ and 45 = 3² × 5. GCF = 3² = 9.
- 14 = 2 × 7 and 25 = 5². No shared prime, so GCF = 1 (coprime).
- 60 = 2² × 3 × 5 and 84 = 2² × 3 × 7. GCF = 2² × 3 = 12.
- 90 = 2 × 3² × 5 and 126 = 2 × 3² × 7. GCF = 2 × 3² = 18.
- 120 = 1 × 84 + 36; 84 = 2 × 36 + 12; 36 = 3 × 12 + 0. GCF = 12.
- 391 = 1 × 299 + 92; 299 = 3 × 92 + 23; 92 = 4 × 23 + 0. GCF = 23.
- 18 = 2 × 3², 30 = 2 × 3 × 5, 42 = 2 × 3 × 7. GCF = 2 × 3 = 6.
- GCF(84, 126) = 42, so 84/126 = 2/3.
- GCF(20, 30) = 10, so LCM = 20 × 30 ÷ 10 = 60.
- GCF(40, 56) = 8 kits, each with 5 pencils and 7 erasers.
Frequently asked questions
What is the GCF of 12 and 18?
6. The factors of 12 are 1, 2, 3, 4, 6, 12 and those of 18 are 1, 2, 3, 6, 9, 18; the largest common one is 6.
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor (GCF) is the usual term in US schools, greatest common divisor (GCD) in higher math and programming, and highest common factor (HCF) in the UK and India. They all name the same number.
How do you find the GCF of 3 numbers?
Multiply the primes shared by all three numbers, each with its lowest power, or find the GCF of two numbers first and then of that result and the third. GCF(24, 36, 60) = 12. See GCF of 3 numbers.
What is the Euclidean algorithm?
A method to find the GCF by repeated division: divide, replace the pair by the divisor and the remainder, and stop when the remainder is 0. The last divisor is the GCF. See the worked example for 252 and 198.
What is the GCF of two prime numbers?
1, because two different primes have no common factor except 1. The same is true for any two coprime numbers, like 8 and 15.
Keep learning
- Previous topic: least common multiple.
- Next topic: prime numbers.
- All topics: math step by step.
- The greatest common factor makes simplifying fractions a one-step job.
- Calculator: LCM and GCF calculator.
- To print: LCM and GCF worksheets with answer keys.
Spotted a mistake or have a request? Send us a short message and we will take care of it.