The short answer: the HCF is the largest number that divides every number in the set; the LCM is the smallest number that every one of them divides. In a word problem, ask whether you are splitting into the biggest equal pieces (HCF) or waiting for things to coincide (LCM). For two numbers, HCF × LCM = product of the numbers.

Using prime factors

Write each number as a product of primes. The HCF takes each common prime with its lowest power; the LCM takes every prime with its highest power.

Example 1. Find the HCF and LCM of 84 and 126. 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7. HCF = 2 × 3 × 7 = 42. LCM = 2² × 3² × 7 = 4 × 9 × 7 = 252. Check the product rule: 42 × 252 = 10,584 and 84 × 126 = 10,584.

Which one does the question want?

Spotting the operation
The question saysUse
largest, greatest, biggest equal pieces, maximum number of rowsHCF
smallest, least, meet again, ring together, minimum lengthLCM
remainder r left in every case (divide)HCF of (number − r)
remainder r left in every case (smallest number)LCM + r

Example 2: equal pieces

Three ropes are 240 cm, 360 cm and 450 cm long. They are cut into pieces of equal length, as long as possible, with nothing left over. How long is each piece and how many pieces are there? 240 = 2⁴ × 3 × 5; 360 = 2³ × 3² × 5; 450 = 2 × 3² × 5². The lowest powers give HCF = 2 × 3 × 5 = 30 cm. Pieces: 240 ÷ 30 = 8, 360 ÷ 30 = 12, 450 ÷ 30 = 15. Total = 35 pieces.

Example 3: a remainder question

Find the smallest number which leaves remainder 5 when divided by 12, 15 and 20. The number is 5 more than a common multiple, and we want the smallest one. 12 = 2² × 3, 15 = 3 × 5, 20 = 2² × 5, so LCM = 2² × 3 × 5 = 60. The number is 60 + 5 = 65. Check: 65 = 12 × 5 + 5, 15 × 4 + 5, 20 × 3 + 5.

Example 4: the product rule

The HCF of two numbers is 6 and their LCM is 180. One number is 36. Find the other. Product = 6 × 180 = 1,080. Other number = 1,080 ÷ 36 = 30. Check: HCF(36, 30) = 6 and LCM(36, 30) = 180. This rule works for two numbers only. It does not extend to three.

Shortcut for the HCF of two large numbers

Divide the larger by the smaller, then divide the divisor by the remainder, and keep going until the remainder is 0. The last divisor is the HCF. For 126 and 84: 126 = 84 × 1 + 42; 84 = 42 × 2 + 0. HCF = 42, which matches Example 1.

Common mistakes

  • Using the highest power for the HCF, or the lowest for the LCM.
  • Applying HCF × LCM = product to three numbers.
  • Answering 60 instead of 65 in a remainder question.
  • Giving the LCM when the question wants the number of pieces or rows.
  • Dropping a prime that appears in only one number from the LCM.

Course · Beginner · Free

Quantitative Aptitude — LCM and HCF: Foundation

Foundation course on LCM and HCF (Quantitative Aptitude): the basics, explained from the start.

Practise HCF and LCM word problems.

Take a practice test

Frequently asked questions

What is the difference between HCF and LCM?

The HCF is the greatest number that divides all the numbers. The LCM is the least number that all of them divide. The HCF is never larger than the smallest number; the LCM is never smaller than the largest.

Is HCF the same as GCD?

Yes. HCF (highest common factor) and GCD (greatest common divisor) mean the same thing.

What is the HCF of two co-prime numbers?

It is 1, and their LCM is simply their product.

How do I find the HCF of fractions?

HCF of fractions = HCF of numerators ÷ LCM of denominators, when each fraction is in its lowest terms.

What if the remainder is different for each divisor?

If each divisor d leaves remainder r and the gap d − r is the same, use LCM − that gap. Otherwise a different method is needed.