LCM & HCF Step-by-Step

Enter 2 to 5 numbers and see factor trees, prime powers, the division (ladder) method, Euclid’s algorithm and a Venn diagram — every step of the working.

Class 4–10 Factor trees 4 methods Up to 10,00,000

To find the HCF and LCM, break each number into primes. The HCF is the product of the common primes at their lowest powers; the LCM takes every prime at its highest power. For 12 = 2² × 3 and 18 = 2 × 3², the HCF is 6 and the LCM is 36. Check with LCM × HCF = a × b.

Your numbers

2 to 5 whole numbers, each from 2 to 10,00,000. Results update as you type.

Try an example
LCM (Lowest Common Multiple)
36

Factor trees & prime factorisation

Keep splitting until every branch ends in a prime (the coloured circles).

Exponent form

Step-by-step methods

Four ways to reach the same answer — use the one your textbook teaches.

Check the answer

Quick ways to be sure the LCM and HCF are right.

Word problems: LCM or HCF?

Read the question for clue words, then decide which one you need.

Use HCF when you split or share

You are breaking things into the largest equal groups or pieces with nothing left over. The answer is smaller than or equal to the numbers.

greatestlargestmaximumcut into equal lengthsshare equallyarrange in rowsexactly divides

Use LCM when things repeat and meet

Events repeat on different cycles and you want the first time they happen together. The answer is bigger than or equal to the numbers.

smallestleastminimumtogether againat the same timering / flash togetherdivisible by each

Solved examples — tap “Load numbers” to see the full working above

How it works

LCM and HCF, explained simply

Both come from the same prime building blocks — the only difference is whether you take the lowest or the highest power.

Enter your numbers

Type 2 to 5 whole numbers, or tap an example to fill them in.

Read the factor trees

Each tree breaks a number into primes. The exponent form is written below the trees.

Pick a method

Switch between prime powers, the ladder (division) method, Euclid’s algorithm and the Venn diagram.

Check and print

Verify with LCM × HCF, then copy or print the full working for your notebook.

HCF — Highest Common Factor

The biggest number that divides every given number exactly. Also called GCD (Greatest Common Divisor).

HCF = product of common primes, lowest powers

12 = 2² × 3 and 18 = 2 × 3² → HCF = 2 × 3 = 6.

LCM — Lowest Common Multiple

The smallest number that every given number divides into exactly.

LCM = product of all primes, highest powers

12 = 2² × 3 and 18 = 2 × 3² → LCM = 2² × 3² = 36.

Euclid’s division algorithm

Divide the larger number by the smaller: a = b × q + r. Replace (a, b) with (b, r) and repeat. When the remainder becomes 0, the last divisor is the HCF.

126 = 84 × 1 + 42 → 84 = 42 × 2 + 0 → HCF = 42.

A handy relationship

For any two numbers a and b:

LCM(a, b) × HCF(a, b) = a × b

So if you know one, you can find the other: LCM(84, 126) = 84 × 126 ÷ 42 = 252. This does not work for three or more numbers.

Exam tip: HCF is always a factor of the LCM, and two numbers are co-prime when their HCF is 1 — then their LCM is simply their product (e.g. 8 and 15 → LCM 120).
Questions & answers

LCM & HCF Step-by-Step — your questions

What is the difference between LCM and HCF?

The HCF (Highest Common Factor, also called GCD) is the biggest number that divides every given number exactly, so it is never larger than the smallest number. The LCM (Lowest Common Multiple) is the smallest number that every given number divides into, so it is never smaller than the largest number.

How do I find the HCF by the division method?

Divide the larger number by the smaller and keep the remainder: 126 ÷ 84 leaves 42. Now divide the old divisor by that remainder: 84 ÷ 42 leaves 0. The last divisor is the HCF, so HCF(84, 126) = 42. This is Euclid's division algorithm, written as a = b × q + r.

What is the formula connecting LCM and HCF?

For any two numbers a and b, LCM × HCF = a × b. So if the HCF of 84 and 126 is 42, the LCM is 84 × 126 ÷ 42 = 252. This shortcut is worth marks in an exam, but it only works for two numbers — it is not valid for three or more.

Should a word problem use LCM or HCF?

Use HCF when you are splitting things into the largest equal groups or pieces with nothing left over — look for greatest, largest, maximum, share equally or cut into equal lengths. Use LCM when events repeat on different cycles and you want the first time they happen together — look for least, smallest, together again or ring at the same time.

What are co-prime numbers?

Two numbers are co-prime when their HCF is 1, meaning they share no common factor except 1. For co-prime numbers the LCM is simply their product, so for 8 and 15 the LCM is 120. The numbers themselves do not have to be prime — 8 and 15 are both composite yet still co-prime.

How do I find the LCM of three numbers?

Factorise each number and take every prime at its highest power. For 24 = 2³ × 3, 36 = 2² × 3² and 48 = 2⁴ × 3, the highest powers are 2⁴ and 3², so the LCM is 16 × 9 = 144. The ladder method works too: divide all three by common primes until only co-prime numbers remain.

How do I check my LCM and HCF answers?

Three quick checks catch most mistakes. The HCF must divide every number exactly, every number must divide the LCM exactly, and the HCF must itself be a factor of the LCM. For two numbers you can also test LCM × HCF against the product of the numbers.