How to Find the Greatest Common Factor (3 Easy Methods)
By Shihab Mia July 3, 2026 8 min read
Quick answer
To find the greatest common factor (GCF) of two or more numbers, find the largest integer that divides every number with no remainder. The three standard methods are: list all factors and pick the biggest shared one, use prime factorization (multiply the primes they share at the lowest power), or run the Euclidean algorithm, gcd(a, b) = gcd(b, a mod b). For example, the GCF of 12 and 18 is 6.
The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest whole number that divides two or more integers evenly, leaving no remainder. It shows up everywhere in real math work: reducing fractions to lowest terms, simplifying ratios, factoring algebra expressions, and splitting quantities into equal groups. This guide walks through all three methods with worked examples so you can pick the one that fits your numbers.
What is the greatest common factor?
The greatest common factor of a set of integers is the largest positive integer that divides each of them without a remainder. "Factor" and "divisor" mean the same thing here, so GCF and GCD are two names for the identical value. If the only factor two numbers share is 1, they are called coprime or relatively prime, and their GCF is 1.
A quick example: the factors of 12 are 1, 2, 3, 4, 6, 12, and the factors of 18 are 1, 2, 3, 6, 9, 18. The factors they have in common are 1, 2, 3, and 6. The largest of those is 6, so the GCF of 12 and 18 is 6. Every method below is just a faster or more scalable way of reaching that same answer.
Method 1: List the factors and pick the biggest shared one
Listing factors is the most intuitive method and works well for small numbers. Write out every factor of each number, circle the ones that appear in both lists, and choose the largest. It requires no formulas, which makes it a great way to build understanding before moving to faster techniques.
- List every factor of the first number.
- List every factor of the second number.
- Identify the factors that appear in both lists (the common factors).
- Select the largest common factor. That is your GCF.
Listing factors to find the GCF of 24 and 36
| Number | All factors | Common factors | GCF |
|---|---|---|---|
| 24 | 1, 2, 3, 4, 6, 8, 12, 24 | 1, 2, 3, 4, 6, 12 | 12 |
| 36 | 1, 2, 3, 4, 6, 9, 12, 18, 36 | 1, 2, 3, 4, 6, 12 | 12 |
The largest number appearing in both factor lists is 12, so the GCF of 24 and 36 is 12. The downside of this method is obvious once numbers get large: listing every factor of a number like 4,896 by hand is slow and error prone. That is where the next two methods earn their keep.
Method 2: Use prime factorization
Prime factorization finds the GCF by breaking each number into its prime building blocks, then multiplying together the primes they share, using the lowest power that appears in either number. This scales far better than listing factors and also reveals the least common multiple as a bonus.
- Break each number into its prime factors (for example, using a factor tree).
- Write each number as a product of primes with exponents.
- For every prime that appears in both, take the lowest exponent.
- Multiply those shared prime powers together to get the GCF.
Worked example, GCF of 48 and 60. First, 48 = 2 to the 4th times 3, and 60 = 2 squared times 3 times 5. The primes they share are 2 and 3. For 2, the lower power is 2 squared (which is 4); for 3, the lower power is 3 to the first (which is 3). There is no shared 5. Multiply: 4 times 3 = 12. So the GCF of 48 and 60 is 12.
Prime factorization of 48 and 60
| Number | Prime factorization | Shared primes (lowest power) |
|---|---|---|
| 48 | 2 x 2 x 2 x 2 x 3 | 2 x 2 x 3 |
| 60 | 2 x 2 x 3 x 5 | 2 x 2 x 3 |
Prime factorization also extends cleanly to three or more numbers: just include a prime only if it appears in every number, and always take its lowest power. If you want to compare this with its close cousin, the least common multiple, our LCM calculator uses the same prime factors but takes the highest power of each instead.
Method 3: Use the Euclidean algorithm (fastest for big numbers)
The Euclidean algorithm is the fastest method for large numbers and the one computers use internally. It relies on a simple identity: gcd(a, b) = gcd(b, a mod b), where "a mod b" is the remainder when a is divided by b. You repeat this step, replacing the pair with (b, remainder), until the remainder reaches 0. The last nonzero value is the GCF.
This method is well over two thousand years old, appearing in Euclid's Elements around 300 BCE, and it remains the standard because it needs no factoring at all. You can read a formal treatment on Wolfram MathWorld.
- Divide the larger number by the smaller one and keep the remainder.
- Replace the larger number with the smaller number, and the smaller with the remainder.
- Repeat until the remainder is 0.
- The last nonzero remainder (the final divisor) is the GCF.
Euclidean algorithm for gcd(252, 105)
| Step | a | b | a mod b |
|---|---|---|---|
| 1 | 252 | 105 | 42 |
| 2 | 105 | 42 | 21 |
| 3 | 42 | 21 | 0 |
When the remainder hits 0 at step 3, the divisor at that step is 21, so the GCF of 252 and 105 is 21. Notice how few steps it took, even though listing all factors of 252 would have been tedious. This efficiency is exactly why the Euclidean algorithm powers modern cryptography and computer algebra systems.
How do you use the GCF to simplify a fraction?
To simplify a fraction, divide both the numerator and denominator by their GCF, and the result is the fraction in lowest terms. This is the most common everyday use of the greatest common factor, and it works in a single pass instead of cancelling small factors one at a time. Because the GCF is the largest shared divisor, dividing by it guarantees the fraction cannot be reduced any further.
- Find the GCF of the numerator and the denominator using any method above.
- Divide the numerator by the GCF.
- Divide the denominator by the same GCF.
- Write the two results as your simplified fraction.
Worked example, simplify 24/36. The GCF of 24 and 36 is 12 (from the listing table earlier). Divide the top: 24 divided by 12 = 2. Divide the bottom: 36 divided by 12 = 3. So 24/36 reduces to 2/3, which cannot be reduced further because 2 and 3 are coprime. If you want more practice with this exact skill, our step-by-step guide on how to simplify fractions walks through several more examples.
Does the GCF work with negative numbers or zero?
Yes, the greatest common factor is defined for negative numbers and for zero, with two simple rules. For negatives, the GCF ignores the sign and is always reported as a positive value, so gcd(-12, 18) is the same as gcd(12, 18), which is 6. For zero, gcd(a, 0) equals the absolute value of a, because every integer divides 0 evenly, so the largest divisor the pair can share is a itself. The one undefined case is gcd(0, 0), since every integer divides zero and there is no single largest one.
GCF with signs and zero
| Pair | GCF | Why |
|---|---|---|
| -12 and 18 | 6 | Sign is ignored; treated as 12 and 18 |
| 15 and 0 | 15 | Every number divides 0, so the answer is 15 |
| 0 and 0 | Undefined | No single largest common divisor exists |
Which method should you use?
Each method reaches the same answer, so the best choice depends on the size of your numbers and whether you are doing the work by hand.
Choosing a GCF method
| Method | Best for | Speed | Needs factoring? |
|---|---|---|---|
| Listing factors | Small numbers, learning the concept | Slow | No |
| Prime factorization | Medium numbers, also finding LCM | Moderate | Yes |
| Euclidean algorithm | Large numbers, computing by machine | Fast | No |
- Just learning? Start with listing factors so the idea of a "common" divisor is concrete.
- Reducing a fraction? Prime factorization pairs nicely because you often need the LCM too.
- Big numbers or a quick answer? Use the Euclidean algorithm, or skip the arithmetic entirely with a calculator.
Common mistakes to avoid
The GCF is easy to compute but also easy to slip up on. Watch for these errors, which trip up students and adults alike.
- Confusing GCF with LCM. The greatest common factor is the largest number that divides into your numbers; the least common multiple is the smallest number they both divide into. They are opposites.
- Taking the highest power instead of the lowest. In prime factorization, the GCF uses the lowest shared exponent. Taking the highest power gives you the LCM by mistake.
- Forgetting a common factor is shared by all numbers. With three or more values, a prime only counts if it appears in every single one, not just some.
- Stopping the Euclidean algorithm too early. Keep going until the remainder is exactly 0; the GCF is the last nonzero divisor, not the last remainder.
- Including 1 as the "answer" too quickly. If numbers share only 1, they are coprime and the GCF genuinely is 1, but double check you have not missed a larger shared factor.
Since finding the GCF is fundamentally about breaking numbers apart, it pairs well with other number-sense skills. If you are working through fractions, ratios, or percentages, our guide on how to calculate a percentage covers a related everyday skill, and how to calculate an average rounds out the basics.
Find the GCF instantly
If you would rather skip the arithmetic, enter your numbers below and get the greatest common factor in one click. It uses the Euclidean algorithm under the hood, so it handles large values instantly and works for two or more numbers at once.
๐ข Try the free tool GCD Calculator Free GCD calculator with steps. Enter two or more integers to get the greatest common divisor, the Euclidean algorithm working, LCM, and shared prime factors.Once you understand the three methods, the greatest common factor becomes a quick, reliable tool for simplifying fractions, factoring expressions, and dividing things into equal groups. Pick listing for small numbers, prime factorization when you also need the LCM, and the Euclidean algorithm whenever the numbers get large, and you will always land on the same correct answer.
Frequently asked questions
What is the greatest common factor of 12 and 18?
The greatest common factor of 12 and 18 is 6. The factors of 12 are 1, 2, 3, 4, 6, 12, and the factors of 18 are 1, 2, 3, 6, 9, 18. The common factors are 1, 2, 3, and 6, and the largest of those is 6.
Is the greatest common factor the same as the greatest common divisor?
Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the exact same value: the largest integer that divides two or more numbers with no remainder. "Factor" and "divisor" are interchangeable here, so the terms are fully synonymous.
What is the fastest way to find the GCF of large numbers?
The Euclidean algorithm is fastest. Use gcd(a, b) = gcd(b, a mod b): divide the larger number by the smaller, keep the remainder, then repeat with the smaller number and that remainder until the remainder is 0. The last nonzero divisor is the GCF, and it needs no factoring.
Can the greatest common factor be 1?
Yes. If two or more numbers share no common factor other than 1, their GCF is 1 and they are called coprime or relatively prime. For example, 8 and 15 share only the factor 1, so their greatest common factor is 1 even though neither number is prime.
How do you find the GCF of three or more numbers?
Use prime factorization or the Euclidean algorithm. With primes, include only the primes that appear in every number and take the lowest power of each. With the Euclidean algorithm, find the GCF of the first two numbers, then find the GCF of that result and the next number, and so on.
What is the GCF used for in real life?
The greatest common factor is used to reduce fractions to lowest terms, simplify ratios, factor algebraic expressions, and split quantities into equal groups. For instance, arranging 24 apples and 36 oranges into identical baskets uses the GCF, 12, to find the most baskets possible.
How do you simplify a fraction using the GCF?
Divide both the numerator and the denominator by their GCF, and the result is the fraction in lowest terms. For example, 24/36 has a GCF of 12, so dividing gives 24 divided by 12 = 2 on top and 36 divided by 12 = 3 on the bottom, which reduces to 2/3. Because the GCF is the largest shared divisor, one division fully simplifies the fraction.
What is the greatest common factor of two prime numbers?
The GCF of two different prime numbers is always 1, because a prime has only two factors, 1 and itself, so the only divisor two distinct primes can share is 1. For example, gcd(7, 13) is 1. If the two numbers are the same prime, such as 7 and 7, then the GCF is that prime itself.