To find the GCF (also called the HCF or GCD) of two numbers, list their factors, compare prime factorisations, or use Euclid's algorithm of repeated division. For 252 and 105 the GCF is 21. The LCM then follows from a shortcut: LCM = (a × b) ÷ GCF, which gives 252 × 105 ÷ 21 = 1,260.
This guide works through all three methods with examples, explains when each one is quickest, and covers the two traps that cost marks: using the LCM shortcut on three numbers, and confusing "common factor" with "common multiple". Every answer below was checked with the AltFTool LCM and GCD calculator and the prime factorization calculator.
What the GCF and LCM are for
The greatest common factor is the largest whole number that divides every number in the set exactly. GCF, HCF (highest common factor) and GCD (greatest common divisor) are three names for the same thing. The least common multiple is the smallest positive number that every number in the set divides into exactly.
A simple way to tell which one a word problem wants: if you are splitting things into the largest equal groups, it is the GCF; if you are waiting for things to line up again, it is the LCM.
| Problem | Numbers | You need | Answer |
|---|---|---|---|
| Simplify the fraction 84/120 | 84, 120 | GCF | 12, so 84/120 = 7/10 |
| Largest square tile for an 84 cm × 120 cm board | 84, 120 | GCF | 12 cm tiles, 7 × 10 = 70 of them |
| Add 1/12 + 1/18 | 12, 18 | LCM | 36, so 3/36 + 2/36 = 5/36 |
| Buses every 12 and 18 minutes; when together again? | 12, 18 | LCM | After 36 minutes |
Method 1: list the factors (and multiples)
For small numbers, writing everything out is fastest and hardest to get wrong.
- List every factor of each number. Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18.
- Circle the factors that appear in both lists: 1, 2, 3, 6.
- The largest one is the GCF: 6.
For the LCM, list multiples instead. Multiples of 12: 12, 24, 36, 48. Multiples of 18: 18, 36, 54. The first number in both lists, 36, is the LCM.
Listing breaks down quickly as numbers grow: 252 has 18 factors, and listing multiples of two three-digit numbers until they meet can take dozens of terms. That is when the next two methods earn their place.
Method 2: prime factorisation
Break each number into primes, then compare the powers of each prime.
- GCF: take each prime that appears in every number, at its lowest power.
- LCM: take each prime that appears in any number, at its highest power.
| Number | 2 | 3 | 5 | 7 | Prime factorisation |
|---|---|---|---|---|---|
| 84 | 2² | 3 | — | 7 | 2² × 3 × 7 |
| 120 | 2³ | 3 | 5 | — | 2³ × 3 × 5 |
| GCF (lowest powers of shared primes) | 2² | 3 | — | — | 2² × 3 = 12 |
| LCM (highest powers of all primes) | 2³ | 3 | 5 | 7 | 2³ × 3 × 5 × 7 = 840 |
This method shows why the answers are what they are, and it extends to three or more numbers without any change. Its weakness is the factorising itself: for large numbers with big prime factors, finding the primes is slow by hand. The prime number checker helps when you are unsure whether a factor is prime.
Enter two whole numbers to get their greatest common factor and LCM instantly, with decimals flagged rather than silently rounded.
Method 3: Euclid's algorithm
Euclid's algorithm needs no factorising at all, which makes it the quickest method for large numbers by hand, and it is the method the AltFTool LCM and GCD calculator uses. It rests on one fact: the GCF of two numbers is also the GCF of the smaller number and the remainder when you divide the larger by the smaller.
- Divide the larger number by the smaller and note the remainder.
- Replace the larger number with the smaller, and the smaller with the remainder.
- Repeat until the remainder is 0.
- The last non-zero remainder (the final divisor) is the GCF.
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 252 ÷ 105 | 2 | 42 |
| 2 | 105 ÷ 42 | 2 | 21 |
| 3 | 42 ÷ 21 | 2 | 0 |
Three divisions, and no need to know that 252 = 2² × 3² × 7 or that 105 = 3 × 5 × 7. The method is very old: it is set out in Book VII of Euclid's Elements, written more than two thousand years ago, as the way to find the greatest common measure of two numbers.
The LCM shortcut, and three or more numbers
For two numbers, GCF × LCM = a × b. So once you have the GCF, LCM = (a × b) ÷ GCF. For 84 and 120: 84 × 120 = 10,080, and 10,080 ÷ 12 = 840. Dividing first, as (84 ÷ 12) × 120, keeps the numbers smaller and gives the same 840.
For three or more numbers, work in pairs: GCF(a, b, c) = GCF(GCF(a, b), c), and the LCM works the same way. Do not use the product shortcut on all three at once. It fails:
| Numbers | GCF | LCM | GCF × LCM | Product of the numbers |
|---|---|---|---|---|
| 12, 18 | 6 | 36 | 216 | 216 ✓ |
| 12, 18, 30 | 6 | 180 | 1,080 | 6,480 ✗ |
Common mistakes
- Mixing up which one you need. If the answer must be smaller than (or equal to) your numbers, you want the GCF; if it must be larger than or equal to them, the LCM.
- Stopping the factor list early. Missing one factor in Method 1 can hide the true GCF. Factors come in pairs, so pair them off (1 × 18, 2 × 9, 3 × 6) to be sure.
- Taking the wrong powers. The GCF uses the lowest power of each shared prime; the LCM uses the highest power of every prime. Swapping these is an easy slip to make.
- Forgetting co-prime numbers. When two numbers share no prime factor, the GCF is 1 and the LCM is simply their product: GCF(8, 9) = 1, LCM = 72.
- Using the product rule on three numbers. As the table above shows, it only holds for two.
Frequently asked questions
Find the GCF of the numbers (6), then take each variable that appears in every term at its lowest power: x to the power 1 and y to the power 1. The GCF is 6xy.
For small numbers, listing factors. For numbers whose prime factors you can see quickly, prime factorisation. For large numbers, Euclid's algorithm, because it needs only a few divisions and no factorising: GCF(252, 105) takes three steps.
Only for exactly two numbers. For 4, 6 and 10 the GCF is 2 and the LCM is 60, so GCF × LCM is 120, while the product of the three numbers is 240.
Always 1, unless they are the same prime. Two different primes share no factor other than 1, so their LCM is just their product: GCF(17, 23) = 1 and LCM(17, 23) = 391.
Find the GCF of the first two, then find the GCF of that result and the third number. For 12, 18 and 30: GCF(12, 18) = 6, then GCF(6, 30) = 6.
Yes, when the smaller number divides the larger exactly. GCF(12, 36) is 12, and the LCM is then the larger number, 36.
Sources and notes
Links the author listed for this post.
- 1Euclid's Elements, Book VII, Proposition 2 (opens in a new tab)
Clark University (D. E. Joyce)







Discussion
0 comments