Prime Factorisation, HCF and LCM
Learn to break numbers into prime factors, then use those factors to find the highest common factor and lowest common multiple. Small examples come first, followed by GCSE problems.
Foundation-first, for both tiers. The final worked example and practice question extend the same methods to three numbers.
Start with prime building blocks
A prime number has exactly two positive factors: 1 and itself. Prime factorisation writes a whole number greater than 1 as a multiplication of primes.
For example, 12 can be built from 2 × 2 × 3. These prime building blocks help us find shared factors and shared multiples.
We will start with small numbers, then use the same idea for HCF and LCM. All numbers in the methods below are positive whole numbers.
Example Question:
Two lights flash every 8 seconds and every 12 seconds. They flash together now. When will they next coincide?
We need a shared multiple, not a shared factor. Example 10 shows how to find the first one.
Exam Tip
Read whether the question wants a product of primes, an HCF or an LCM.
After choosing the prime powers for an HCF or LCM, multiply them to give the numerical answer.
Method — Build, select, check
1. Split. Choose a factor pair with both factors greater than 1.
2. Mark primes. Circle each prime end. Keep splitting any composite ends.
3. Collect. Write every prime end as a multiplication. Include repeated copies.
4. Shorten. Use index notation for repeated primes.
5. Select. HCF uses copies shared by all the numbers. LCM uses enough copies to build each number.
6. Check. Multiply back, or check exact division as appropriate.
Worked Examples
Example 1 — Turn a number into prime factors
Write 12 as a product of primes. Product means the result of multiplication.
12 = 3 × 4
3 is prime, but 4 is composite. Split 4 again:
4 = 2 × 2
Read only the circled ends, not the numbers we have already split.
12 = 3 × 2 × 2
Putting the primes in ascending order gives 12 = 2 × 2 × 3.
Two copies of 2 can be written as 22. The raised 2 is the index: it counts copies of the base 2.
12 = 22 × 3
Here 22 means 2 × 2, not 2 + 2. With three copies, 23 means 2 × 2 × 2.
Example 2 — Use different trees for the same number
Prime factorise 24. You can choose any convenient factor pair with both factors greater than 1.
First route: 24 = 6 × 4. Split 6 into 2 × 3 and 4 into 2 × 2.
Second route: 24 = 3 × 8. Keep the prime 3, split 8 into 2 × 4, then split 4 into 2 × 2.
Both routes end with three copies of 2 and one copy of 3.
24 = 2 × 2 × 2 × 3 = 23 × 3
The order of the prime factors can differ. Their values and the number of copies do not. This lets you choose an easy starting pair.
Example 3 — Write index form and check it
Prime factorise 60.
60 = 6 × 10
6 = 2 × 3
10 = 2 × 5
Collect every prime end: 60 = 2 × 3 × 2 × 5.
Group repeated primes: 60 = 22 × 3 × 5.
Check by multiplying back:
22 = 4
4 × 3 = 12
12 × 5 = 60
The check confirms the product. Also check that every final factor is prime: a correct product containing 6 would not yet be a prime factorisation.
Example 4 — Find HCF using short lists
The highest common factor (HCF) is the greatest positive factor shared by all the numbers.
Find the HCF 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.
The greatest is 6, so HCF = 6.
Example 5 — Find HCF from prime factors
Find the HCF of 24 and 36.
24 = 23 × 3
36 = 22 × 32
| Prime | Copies in 24 | Copies in 36 | Copies shared |
|---|---|---|---|
| 2 | 3 | 2 | 2 |
| 3 | 1 | 2 | 1 |
A common factor can use only copies available in both numbers.
We can use two copies of 2, but not three: 36 has only two.
We can use one copy of 3, but not two: 24 has only one.
HCF = 22 × 3
HCF = 4 × 3 = 12
That is why HCF uses the smaller power of each shared prime.
Check: 24 ÷ 12 = 2 and 36 ÷ 12 = 3. It divides both exactly.
Example 6 — Find LCM using short lists
The lowest common multiple (LCM) is the smallest positive multiple shared by all the numbers.
Find the LCM of 4 and 6.
Positive multiples of 4: 4, 8, 12, 16, …
Positive multiples of 6: 6, 12, 18, …
The first shared positive multiple is 12, so LCM = 12.
Zero is a shared multiple too, but LCM means the lowest positive common multiple.
Example 7 — Find LCM from prime factors
Find the LCM of 12 and 18.
12 = 22 × 3
18 = 2 × 32
| Prime | Copies needed for 12 | Copies needed for 18 | Copies to include |
|---|---|---|---|
| 2 | 2 | 1 | 2 |
| 3 | 1 | 2 | 2 |
Our common multiple must contain enough copies to build either original number.
Include two copies of 2 for 12 and two copies of 3 for 18.
Those same copies can serve both numbers. We do not add all their copies together.
LCM = 22 × 32
LCM = 4 × 9 = 36
That is why LCM uses the larger power of every prime needed.
Check: 36 ÷ 12 = 3 and 36 ÷ 18 = 2.
Example 8 — Do not lose a prime that appears in only one number
Find the HCF and LCM of 8 and 15.
8 = 23
15 = 3 × 5
There are no shared prime factors, so the only shared positive factor is 1.
HCF = 1
For LCM, include all the primes needed by either number.
LCM = 23 × 3 × 5
LCM = 8 × 15 = 120
Check: 120 ÷ 8 = 15 and 120 ÷ 15 = 8. Using only shared primes would miss everything needed here.
Example 9 — Choose HCF for identical packs
A teacher has 24 pencils and 36 erasers. She wants the greatest possible number of identical packs, using everything. Each pack must contain the same number of pencils and the same number of erasers.
The number of packs must divide both 24 and 36 exactly. We need the greatest shared factor: HCF.
From Example 5, HCF of 24 and 36 = 12.
She can make 12 packs.
Pencils per pack = 24 ÷ 12 = 2.
Erasers per pack = 36 ÷ 12 = 3.
Check: 12 packs use 12 × 2 = 24 pencils and 12 × 3 = 36 erasers.
Example 10 — Choose LCM for repeating events
Two lights flash together now. One flashes every 8 seconds, the other every 12 seconds. When will they next flash together?
The waiting time must be a positive multiple of both intervals. The next shared time needs the LCM.
8 = 23
12 = 22 × 3
LCM = 23 × 3
LCM = 8 × 3 = 24
They next flash together after 24 seconds.
Check: 24 seconds is three intervals of 8 seconds and two intervals of 12 seconds.
Example 11 — Extend the method to three numbers — challenge
Find the HCF and LCM of 12, 18 and 30.
12 = 22 × 3
18 = 2 × 32
30 = 2 × 3 × 5
For HCF, use copies shared by all three. Each has one 2 and one 3. Not all have a 5.
HCF = 2 × 3 = 6
For LCM, include enough copies for every number: two 2s, two 3s and one 5.
LCM = 22 × 32 × 5
LCM = 4 × 9 × 5 = 180
Check HCF: 12 ÷ 6 = 2, 18 ÷ 6 = 3, 30 ÷ 6 = 5.
Check LCM: 180 ÷ 12 = 15, 180 ÷ 18 = 10, 180 ÷ 30 = 6.
HCF or LCM?
| HCF | LCM |
|---|---|
| Greatest shared factor | Smallest shared positive multiple |
| Must divide every original number | Must be divisible by every original number |
| No larger than the smallest original number | At least as large as the largest original number |
| Equal grouping or longest equal pieces, with nothing left over | Next time repeating events coincide |
Decide what the answer must do. Do not choose a method from the word “greatest” or “smallest” alone.
Check your answer
Prime factorisation: multiply the prime factors back and check that every final factor is prime.
HCF: divide every original number by your answer. Each result must be a whole number. Check you included all shared copies.
LCM: divide your answer by every original number. Each result must be a whole number. Check you included only the copies needed.
These division checks confirm a shared factor or multiple. The prime-copy selection is what makes it the highest or lowest.
Contexts: answer in packs, pieces, centimetres, seconds or minutes as the question requires.
Think Like a Mathematician
Why can LCM reuse a prime copy instead of multiplying the two original numbers?
12 needs two 2s and one 3. Eighteen needs one 2 and two 3s.
The number 36 has two 2s and two 3s. That is enough to build either 12 or 18.
We are not building 12 and 18 as two separate objects at once. We need one number which either can divide.
For HCF the question is different: which copies can both numbers supply? That is why we keep only their shared copies.
Common mistakes to avoid
Stopping too soon: 4 and 6 are composite. Keep splitting until every branch ends in a prime.
Losing repeated factors: two separate ends labelled 2 must both appear in the product.
Misreading an index: 23 means three factors of 2. It does not mean 2 × 3.
Using larger powers for HCF: a common factor cannot need more copies than either original number has.
Using only shared primes for LCM: include primes appearing in just one number too.
Leaving selected factors unmultiplied: finish with a numerical HCF or LCM.
Choosing the wrong method: equal packs need a shared divisor; repeating events need a shared multiple.
Try it yourself
Start with factorisation, then select the prime factors carefully. Write your working before opening each answer. Question 12 is an optional three-number challenge.
1. Write 18 as a product of primes.
18 = 2 × 9.
9 = 3 × 3.
All final factors are prime: 18 = 2 × 3 × 3 = 2 × 32.
2. Complete a factor tree starting with 20 = 4 × 5. Give the answer in index form.
5 is already prime. Split 4 into 2 × 2.
The prime ends are 2, 2 and 5.
20 = 22 × 5. Check: 4 × 5 = 20.
3. Prime factorise 24 starting with 2 × 12 instead of 6 × 4.
Split 12 into 3 × 4, then 4 into 2 × 2.
Keep the first 2 as well as the new prime ends.
24 = 2 × 3 × 2 × 2 = 23 × 3.
It matches the worked example: three copies of 2 and one 3.
4. Write 2 × 2 × 2 × 3 × 3 in index form, then find its value.
Count copies: three 2s and two 3s.
Index form: 23 × 32.
23 = 8 and 32 = 9.
Value = 8 × 9 = 72.
5. A student writes 60 = 2 × 3 × 5. Find and correct the error.
Multiply back: 2 × 3 × 5 = 30, not 60.
One copy of 2 is missing.
60 = 22 × 3 × 5. Check: 4 × 3 × 5 = 60.
6. Find the HCF of 16 and 24 using prime factors.
16 = 24.
24 = 23 × 3.
Only 2 is shared. Both have at least three copies, but 24 does not have four.
HCF = 23 = 8. Check: 16 ÷ 8 = 2 and 24 ÷ 8 = 3.
7. Find the LCM of 10 and 12 using prime factors.
10 = 2 × 5.
12 = 22 × 3.
Include two 2s, one 3 and one 5 to cover both numbers.
LCM = 22 × 3 × 5 = 60.
Check: 60 ÷ 10 = 6 and 60 ÷ 12 = 5.
8. Find both the HCF and LCM of 9 and 20.
9 = 32.
20 = 22 × 5.
No primes are shared, so HCF = 1.
LCM uses all the needed primes: 22 × 32 × 5 = 4 × 9 × 5 = 180.
Check: 180 ÷ 9 = 20 and 180 ÷ 20 = 9.
9. Two ribbons are 48 cm and 60 cm long. Cut both into the longest equal whole-centimetre pieces, with no waste. Find each piece’s length and the total number of pieces.
The piece length must divide both lengths. Longest means find the HCF.
48 = 24 × 3.
60 = 22 × 3 × 5.
HCF = 22 × 3 = 12, so each piece is 12 cm long.
48 ÷ 12 = 4 pieces; 60 ÷ 12 = 5 pieces.
Total = 4 + 5 = 9 pieces.
10. Two alarms sound together now. They repeat every 6 minutes and every 15 minutes. When will they next sound together?
We need the first shared positive time, so use LCM.
6 = 2 × 3 and 15 = 3 × 5.
LCM = 2 × 3 × 5 = 30.
They next sound together after 30 minutes: five 6-minute intervals and two 15-minute intervals.
11. There are 18 red counters and 30 blue counters. Make the greatest number of identical packs using every counter. How many packs, and what is in each?
The pack count must divide both quantities exactly, so use HCF.
18 = 2 × 32 and 30 = 2 × 3 × 5.
HCF = 2 × 3 = 6 packs.
Each has 18 ÷ 6 = 3 red and 30 ÷ 6 = 5 blue counters.
Check: 6 × 3 = 18 and 6 × 5 = 30.
12. Challenge: find the HCF and LCM of 8, 12 and 20.
8 = 23, 12 = 22 × 3, and 20 = 22 × 5.
Two copies of 2 are shared by all three.
HCF = 22 = 4.
For LCM, use three 2s, one 3 and one 5.
LCM = 23 × 3 × 5 = 120.
Checks: 8 ÷ 4 = 2, 12 ÷ 4 = 3, 20 ÷ 4 = 5.
120 ÷ 8 = 15, 120 ÷ 12 = 10, 120 ÷ 20 = 6.
Frequently Asked Questions
Must a factor tree begin with the smallest prime?
No. Any valid factor pair with both factors greater than 1 will work. Continue until all ends are prime.
Why do I circle prime ends?
It marks branches that are finished. Collect only these ends, including every repeated copy.
Can different trees give different prime factors?
For the same number, fully completed valid trees give the same primes with the same number of copies. Their order may differ.
What if there are no shared prime factors?
The HCF is 1. For LCM, still include every prime power needed by either number.
Why is the LCM not zero?
LCM is defined as the lowest positive common multiple. Zero is not positive.
Can these methods work for three numbers?
Yes. HCF keeps copies shared by all three. LCM includes enough copies to build each of the three numbers.
