# How to find the GCF (HCF) and LCM: three methods that work

Find the GCF by listing factors, prime factorisation or Euclid's algorithm, then get the LCM in one step. Worked examples, three-number cases, common slips.

- Author: AltFTool Editorial
- Published: 2026-12-04
- Category: Tools
- Tags: maths, fractions, study skills
- Canonical URL: <https://www.altftool.com/blogs/how-to-find-gcf-hcf-and-lcm-three-methods>

---

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](https://www.altftool.com/tools/all/lcm-and-gcd-calculator) and the [prime factorization calculator](https://www.altftool.com/tools/all/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 |

*GCF and LCM values from the LCM and GCD calculator.*

## 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 |

*Factorisations from the prime factorization calculator.*

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](https://www.altftool.com/tools/all/prime-number-checker) helps when you are unsure whether a factor is prime.

**LCM and GCD Calculator**

Enter two whole numbers to get their greatest common factor and LCM instantly, with decimals flagged rather than silently rounded.

[Open LCM and GCD Calculator](https://www.altftool.com/tools/all/lcm-and-gcd-calculator)

## 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.

1. Divide the larger number by the smaller and note the remainder.
2. Replace the larger number with the smaller, and the smaller with the remainder.
3. Repeat until the remainder is 0.
4. 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 |

*GCF(252, 105) = 21, matching the LCM and GCD calculator.*

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 ✗ |

*GCF and LCM of 12, 18 and 30 from the prime factorization calculator.*

## 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

### How do I find the GCF of terms with variables, like 12x²y and 18xy³?

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.

### Which method is fastest for finding the GCF?

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.

### Does GCF × LCM always equal the product of the numbers?

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.

### What is the GCF of two prime numbers?

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.

### How do I find the GCF of three numbers with Euclid's algorithm?

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.

### Can the GCF be one of the numbers itself?

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

1. [Euclid's Elements, Book VII, Proposition 2](https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html) — Clark University (D. E. Joyce)
