HCF & LCM Calculator

Find the Highest Common Factor and Lowest Common Multiple of any two numbers — using prime factorisation, step by step.

HCF & LCM Calculator

Quick examples:

Step-by-step solution

Enter two numbers and press Calculate

HCF & LCM Calculator Explained

Core concepts, classroom applications, and plain-English explanations for all audiences.

Two problems, two answers

You have 24 apples and 36 oranges — you want to make identical bags with no fruit left over. How many bags? The HCF of 24 and 36 is 12, so 12 bags, each with 2 apples and 3 oranges. Different problem: Bus A runs every 8 minutes, Bus B every 12 minutes — both just left. When will they next leave together? LCM(8,12) = 24 minutes.

Worked example

"Find the HCF and LCM of 12 and 18."

12 = 2² × 3

18 = 2 × 3²

HCF: use minimum powers of shared primes

= 2¹ × 3¹ = 6

LCM: use maximum powers of all primes

= 2² × 3² = 36

Check: 6 × 36 = 216 = 12 × 18 ✓

HCF × LCM always equals the product of the two original numbers.

Common mistake to avoid

  • ✗ Mixing up HCF and LCM: HCF is always ≤ the smaller number (it divides into both); LCM is always ≥ the larger number (both divide into it). If your HCF is bigger than both numbers, or your LCM is smaller than both, something's wrong.

What are HCF and LCM?

The **Highest Common Factor (HCF)**, sometimes called the Greatest Common Divisor (GCD), is the largest number that divides exactly into two or more numbers without leaving a remainder. Think of it as the biggest number that is a factor of both.

The **Lowest Common Multiple (LCM)** is the smallest positive number that is a multiple of two or more numbers. In other words, it's the first number that appears in the times tables of both numbers.

How to find HCF and LCM using Prime Factorisation

1

Prime Factorise Both Numbers

Break down each number into its prime factors. A prime factor is a prime number that divides the original number exactly. Write these as a product of primes, often using powers (e.g., 12 = 2² × 3).

2

Find the HCF

To find the HCF, identify all the prime factors that are *common* to both numbers. For each common prime factor, choose the one with the *lowest* power. Multiply these chosen prime factors together to get the HCF.

3

Find the LCM

To find the LCM, identify *all* the prime factors that appear in either number (common and unique). For each prime factor, choose the one with the *highest* power. Multiply these chosen prime factors together to get the LCM. You can also verify your answer using the rule: HCF × LCM = Number 1 × Number 2.

Common mistakes to avoid

  • Finding the HCF of 12 and 18 is 36:This is a common mistake where students confuse the HCF with the LCM. 36 is a multiple, not a factor, of 12 and 18. The HCF of 12 and 18 is 6. (Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18. The highest common one is 6).
  • The prime factors of 24 are 2, 3, 4:4 is not a prime number. Prime factorisation must only use prime numbers. The prime factors of 24 are 2 × 2 × 2 × 3, or 2³ × 3.
  • When finding the HCF of 2³ × 3 and 2² × 5, I use 2³:For the HCF, you must use the lowest power of the common prime factors. 2³ is the highest power of 2. For the HCF, you should use 2² (as 2² is common to both and is the lowest power). The HCF would be 2² = 4.
  • When finding the LCM of 2³ × 3 and 2² × 5, I use 2² × 3 × 5:For the LCM, you must use the highest power of all prime factors (common and unique). You used the lowest power for 2. For the LCM, you should use 2³ (the highest power of 2), 3 (highest power of 3), and 5 (highest power of 5). The LCM would be 2³ × 3 × 5 = 8 × 3 × 5 = 120.

Questions students ask

1. What is the difference between HCF and LCM?
The HCF (Highest Common Factor) is the largest number that divides into two or more numbers exactly. It's about finding the biggest shared 'building block'. The LCM (Lowest Common Multiple) is the smallest number that two or more numbers will both divide into exactly. It's about finding the first number they both 'meet at' in their times tables.
2. How do I find the HCF using prime factorisation?
First, find the prime factorisation of each number. Then, identify all the prime factors that are common to both numbers. For each common prime factor, take the one with the lowest power. Multiply these selected prime factors together to get the HCF.
3. How do I find the LCM using prime factorisation?
Start by finding the prime factorisation of each number. Next, identify all the prime factors that appear in either number (both common and unique ones). For each of these prime factors, take the one with the highest power. Multiply these selected prime factors together to get the LCM.
4. When would I use HCF in real life?
HCF is useful when you need to divide things into the largest possible equal groups. For example, if you have 24 apples and 36 oranges and want to make identical fruit baskets with no fruit left over, the HCF (which is 12) tells you that you can make 12 baskets, each with 2 apples and 3 oranges. It's also used for simplifying fractions to their lowest terms.
5. When would I use LCM in real life?
LCM is helpful when you need to find a common point in time or quantity. For instance, if one bus comes every 15 minutes and another every 20 minutes, the LCM (which is 60) tells you they will both arrive at the stop together every 60 minutes. It's also essential for adding or subtracting fractions by finding a common denominator.