LCM and HCF Calculator

HCF (GCD)
6
LCM
36

Prime factorisation

  • 12 = 2^2 × 3
  • 18 = 2 × 3^2

Check: 12 × 18 = 216 = HCF × LCM = 6 × 36

What are LCM and HCF?

The HCF (highest common factor, also called GCD) is the largest number that divides all the given numbers exactly. The LCM (least common multiple) is the smallest number that all of them divide into. This calculator finds both for two or more numbers and shows each number's prime factorisation, as you'd write it in an exam.

Prime factorisation method

HCF = product of the lowest powers of common primes · LCM = product of the highest powers of all primes

Write each number as a product of primes. For the HCF, take only the primes that appear in every number, each with its smallest power. For the LCM, take every prime that appears, each with its largest power. For two numbers, HCF × LCM = the product of the numbers.

Tips for exams

  • The HCF can never be larger than the smallest number, and the LCM can never be smaller than the largest.
  • If two numbers are co-prime (HCF = 1), their LCM is simply their product.
  • The HCF × LCM shortcut works for two numbers only, not for three or more.
  • Use the HCF to simplify fractions (divide top and bottom by it), and the LCM to add fractions with different denominators.

Worked example

  1. Find the HCF and LCM of 12 and 18
  2. 12 = 2² × 3 and 18 = 2 × 3²
  3. HCF = 2 × 3 = 6 (lowest powers of the common primes)
  4. LCM = 2² × 3² = 36 (highest powers of all primes)
  5. Check: 12 × 18 = 216 = 6 × 36

HCF and LCM of common pairs

Quick reference for numbers that often come up in exercises.

NumbersHCFLCM
12, 18636
8, 12424
9, 12336
14, 21742
15, 25575
16, 24848
24, 361272

For each pair, HCF × LCM equals the product of the two numbers.

Frequently Asked Questions

36. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.
None; they are two names for the same thing. HCF (highest common factor) is used in Indian textbooks, GCD (greatest common divisor) elsewhere.
Factorise each number and multiply the primes common to all three, each with its lowest power. The HCF of 12, 18 and 24 is 6.
Only for two numbers. For 12 and 18: 6 × 36 = 216 = 12 × 18.