
The greatest common factor (GCF) of two or more numbers is the largest number that divides into all of them exactly. To find it, list the factors and pick the biggest one they share, or multiply the prime factors they have in common. For example, the GCF of 12 and 18 is 6. The GCF is also called the greatest common divisor (GCD) or highest common factor (HCF).
In short: Small numbers: list the factors and pick the largest shared one. Bigger numbers: write each as a product of primes and multiply the shared primes. Very big numbers: use the Euclidean algorithm.
In this guide
Method 1: List the Factors
A factor is a number that divides in exactly. List every factor of each number, then find the largest one that appears in every list.
Example: GCF of 12 and 18. Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18. The common factors are 1, 2, 3 and 6, so the GCF is 6.
This works well for numbers under about 50. For bigger numbers the lists get long, so use prime factors instead.
Method 2: Prime Factorization
- Write each number as a product of primes. A factor tree helps: split the number into two factors and keep going until every branch ends in a prime.
- Find the primes they share. Use each shared prime as many times as it appears in both numbers (the smaller power).
- Multiply them. The product is the GCF.
Example: GCF of 24 and 36. 24 = 2 × 2 × 2 × 3 and 36 = 2 × 2 × 3 × 3. Both have two 2s and one 3, so the GCF is 2 × 2 × 3 = 12.
Method 3: The Ladder (Cake) Method
Write the numbers side by side and divide them both by a prime that goes into both. Repeat on the new row until the numbers share no factor. Multiply the primes on the left to get the GCF.

Example: GCF of 48 and 180. Divide by 2 (24 and 90), by 2 again (12 and 45), then by 3 (4 and 15). 4 and 15 share no factor, so the GCF is 2 × 2 × 3 = 12. The same ladder also gives the LCM: 12 × 4 × 15 = 720.
Method 4: The Euclidean Algorithm
For large numbers, divide the bigger number by the smaller one and keep the remainder. Then divide the old divisor by the remainder. Repeat until the remainder is 0. The last divisor is the GCF.
Example: GCF of 48 and 180. 180 = 3 × 48 + 36. Then 48 = 1 × 36 + 12. Then 36 = 3 × 12 + 0. The remainder is 0, so the GCF is 12.
GCF of Three or More Numbers
Use the primes that appear in every number. You can also find the GCF of the first two numbers, then the GCF of that answer and the next number.
Example: GCF of 18, 24 and 30. 18 = 2 × 3², 24 = 2³ × 3 and 30 = 2 × 3 × 5. Each has one 2 and at least one 3, so the GCF is 2 × 3 = 6.
If the numbers share no prime at all, the GCF is 1. For example, the GCF of 7 and 13 is 1, so they are called relatively prime.
Try it
Type any numbers to see the GCF with a factor tree, a Venn diagram and the Euclidean check.
What the GCF Is Used For
- Simplifying fractions. Divide the top and bottom by their GCF: 18/24 ÷ 6/6 = 3/4. See how to simplify fractions.
- Splitting into equal groups. The largest number of identical groups you can make from 24 apples and 36 oranges is the GCF, 12. See more GCF and LCM word problems.
- Factoring in algebra. In 12x + 18, the GCF of 12 and 18 is 6, so 12x + 18 = 6(2x + 3). See how to factor polynomials.
Common Examples
| Numbers | GCF | How |
|---|---|---|
| 12, 18 | 6 | 2 × 3 |
| 24, 36 | 12 | 2 × 2 × 3 |
| 48, 180 | 12 | ladder: 2 × 2 × 3 |
| 84, 126 | 42 | 2 × 3 × 7 |
| 18, 24, 30 | 6 | 2 × 3 |
| 14, 21 | 7 | shared prime 7 |
| 7, 13 | 1 | no shared prime |
FAQ
What is the greatest common factor?
The greatest common factor (GCF) is the largest whole number that divides exactly into each of the given numbers. The GCF of 12 and 18 is 6.
How do you find the GCF of two numbers?
List the factors of both numbers and pick the largest one they share, or multiply the prime factors they have in common. For 24 and 36: 2 × 2 × 3 = 12.
What is the GCF of 24 and 36?
The GCF of 24 and 36 is 12, because 24 = 2³ × 3 and 36 = 2² × 3², and the shared part is 2² × 3 = 12.
Can the GCF be 1?
Yes. If two numbers share no factor except 1, such as 7 and 13, their GCF is 1 and they are called relatively prime.
Is GCF the same as GCD?
Yes. GCF (greatest common factor), GCD (greatest common divisor) and HCF (highest common factor) all mean the same thing.
Sources and Further Reading
- OpenStax, Prealgebra 2e, Section 10.6: Introduction to Factoring Polynomials (Find the greatest common factor of two or more expressions), Rice University.
- Common Core Grade 6: The Number System (6.NS.B.4).
- Wikipedia, Euclidean algorithm.
Next, learn how to find the LCM or compare the two in GCF vs LCM. Check any answer with the GCF and LCM calculator.
Check your working in seconds
Type any problem from this guide into the free CalcSolver calculator and see the answer, with fractions, instantly.


