Arithmetic & Numbers · Grades 5–8
How to Find the LCM and GCF (HCF) With Prime Factors

Start with prime factors
Write each number as a product of primes. 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3. Exponents keep repeated primes tidy.
GCF: shared primes, lowest powers
Only primes that appear in every number count, each taken at the smallest exponent. The GCF is the largest number that divides all of them.
LCM: every prime, highest powers
Take every prime that appears anywhere, each at its largest exponent. The LCM is the smallest number all of them divide into.
12 and 18
- GCF (HCF) = 6
- LCM = 36
Step-by-step working 4 steps
- 1Prime-factorise every number
12 = 2² × 3 18 = 2 × 3²
Break each number into primes.
- 2GCF: take each shared prime at its lowest power
2 × 3 = 6
Only primes that appear in every number count.
- 3LCM: take every prime at its highest power
2² × 3² = 36
Include every prime that appears in any number.
- 4Cross-check
GCF × LCM = 6 × 36 = 216 12 × 18 = 216
For two numbers the product of GCF and LCM always equals the product of the numbers.
Three numbers and coprime numbers
The same method scales: for 12, 18 and 30 the result is LCM 180 · GCF 6. For numbers with no shared prime, like 8 and 15, the GCF is 1 and the LCM is their product: LCM 120 · GCF 1.
12, 18 and 30
- GCF (HCF) = 6
- LCM = 180
Step-by-step working 3 steps
- 1Prime-factorise every number
12 = 2² × 3 18 = 2 × 3² 30 = 2 × 3 × 5
Break each number into primes.
- 2GCF: take each shared prime at its lowest power
2 × 3 = 6
Only primes that appear in every number count.
- 3LCM: take every prime at its highest power
2² × 3² × 5 = 180
Include every prime that appears in any number.
Common mistakes
Mixing up LCM and GCF
The GCF can never exceed the smallest number; the LCM can never be below the largest.
Using the product as the LCM
a × b is a common multiple but only the least one when the numbers share no factor.
Missing a repeated prime
12 contains the prime 2 twice; keep the exponent.
Frequently asked questions
What is the difference between GCF and HCF?
None — they are two names for the same value.
When do I use the LCM?
For common denominators and for events that repeat on different cycles.



