Math Education

9 min read

How to Calculate LCM and GCF: Prime Factorisation & Worked Examples

Published: 21.05.2026·Updated: 02.06.2026
Dewi Lestari

Dewi Lestari

Mathematics Specialist

How to Calculate LCM and GCF: Prime Factorisation & Worked Examples

LCM (Least Common Multiple) is the smallest number that is divisible by two numbers; GCF (Greatest Common Factor) is the largest factor that divides both of them exactly. The fastest method: prime factorisation — for the LCM take the highest power of every prime factor; for the GCF take the common factors with the lowest power. Example: LCM(12,18)=36, GCF(12,18)=6.

Understanding LCM and GCF

LCM (Least Common Multiple) and GCF (Greatest Common Factor) are two important concepts in mathematics that are often looked up together. These concepts have been known since ancient Greek times — Euclid developed an efficient algorithm for finding the GCF (known as the Euclidean Algorithm) around 300 BC, and the method is still used today.

  • LCM — the smallest number divisible by two or more numbers
  • GCF — the largest factor that divides two or more numbers exactly (also called GCD)

Example for 12 and 18: LCM = 36, GCF = 6.

Venn Diagram: Prime Factors of 12 and 18 12 18 2 (from 2²) 2 × 3 =GCF(6) 3 (from 3²) LCM = all factors = 2² × 3² = 36 GCF = intersection = 2 × 3 = 6
Venn diagram of the prime factors of 12 and 18: the intersection is the GCF, the union of all is the LCM

Formulas for Finding the LCM and GCF

The most efficient method: prime factorisation

From the prime factorisation:

  • LCM: take every prime factor with the highest power
  • GCF: take only the common factors with the lowest power

LCM(12,18) = 2² × 3² = 36 | GCF(12,18) = 2 × 3 = 6

💡 Memory Tip: LCM = "collect everything, highest power" → result is larger. GCF = "common factors, lowest power" → result is smaller.


How to Calculate LCM and GCF: Worked Examples

Example 1: LCM and GCF Together

Find the LCM and GCF of 24 and 36.

Step 1: Prime factorisation

Step 2: LCM (highest power of each factor)

Step 3: GCF (common factors, lowest power)

Answer: LCM(24, 36) = 72 | GCF(24, 36) = 12


Example 2: LCM in a Word Problem

At a primary school in Surabaya, two decorative lights flash together at 08:00. Light A flashes every 6 minutes, Light B every 8 minutes. When will they flash together again?

Step 1: LCM(6, 8): , → LCM = minutes

Step 2: 08:00 + 24 minutes = 08:24

Answer: Both lights flash together again at 08:24


Example 3: GCF in a Word Problem

Rina, a Year 5 primary student in Bandung, has 48 pencils and 36 erasers. She wants to share them equally among her friends with nothing left over. What is the greatest number of groups she can make?

Step 1: GCF(48, 36): , → GCF =

Step 2: Each group: 48÷12 = 4 pencils, 36÷12 = 3 erasers

Answer: 12 groups, each with 4 pencils and 3 erasers


Common Mistakes When Calculating the LCM and GCF

Mistake 1: Swapping the LCM and GCF rules The LCM takes the highest power, not the lowest. The GCF takes the lowest power, not the highest. Memory aid: LCM = Largest = highest power; GCF = common Factors = lowest power. A common slip-up: taking the lowest power for the LCM, giving LCM(12,18) = 2¹ × 3¹ = 6 (this is actually the GCF).

Mistake 2: Forgetting to include a prime factor that only appears in one number When finding LCM(12, 25): 12 = 2² × 3, 25 = 5². A common error: forgetting to include 5² because it does not appear in 12. Correct: LCM = 2² × 3 × 5² = 300. For the LCM, every prime factor from every number must be included.


LCM and GCF Table

Number 1Number 2GCFLCM
812424
1218636
1525575
20301060
24361272

LCM and GCF Practice Problems

Problem 1: ⭐ Find the LCM and GCF of 16 and 24.

Problem 2: ⭐⭐ A bakery in Jakarta makes chocolate cake every 4 days and cheese cake every 6 days. Today both are baked together. In how many days will they next be baked together?

Problem 3: ⭐⭐⭐ There are 60 red marbles and 45 blue marbles. They are to be shared equally among several students. What is the greatest number of students who can receive marbles?

Answer Key:

  1. 16=2⁴, 24=2³×3 → GCF=2³=8 | LCM=2⁴×3=48
  2. LCM(4,6) = 12 days
  3. GCF(60,45): 60=2²×3×5, 45=3²×5 → GCF=3×5=15 students

Summary

  1. The LCM is the smallest number divisible by two or more numbers; find it by taking every prime factor with the highest power.
  2. The GCF is the largest factor that divides two or more numbers exactly; find it by taking only the common prime factors with the lowest power.
  3. The most efficient method is prime factorisation using a factor tree.
  4. The LCM is used for repeating-schedule problems; the GCF is used for sharing things equally.
  5. Remember: the LCM is always ≥ the largest number; the GCF is always ≤ the smallest number.

Want to master the LCM, GCF, and other maths topics with experienced mentors? Algonova has helped more than 1,000,000 students in 90+ countries learn maths through a personalised approach — classes of up to 8 students, with the curriculum tailored to your child's level. Try a free masterclass at Algonova and find the best way for your child to learn maths.

Read also: How to Calculate the Circumference of a Circle and How to Find the Area of a Triangle.