LCM and HCF Calculator

Find the LCM and HCF (GCD) of two or more numbers, with their prime factors.

Results

LCM (lowest common multiple)
—
HCF / GCD (highest common factor)
—
Prime factors
—

HCF (highest common factor, also called GCD) is the largest number that divides all the given numbers. LCM (lowest common multiple) is the smallest number that all of them divide into. Both come up often in school maths, fractions and scheduling problems.

How to use the LCM and HCF calculator

Enter two or more whole numbers, separated by commas or spaces, such as 12, 18, 30.

Prime factorisation method

  1. Break each number into prime factors.
  2. HCF = the product of the common primes, each with the lowest power.
  3. LCM = the product of all primes that appear, each with the highest power.

For two numbers, there is also a shortcut: LCM × HCF = product of the two numbers.

Example

Numbers: 12, 18, 30

  • 12 = 2² × 3
  • 18 = 2 × 3²
  • 30 = 2 × 3 × 5
  • HCF = 2 × 3 = 6
  • LCM = 2² × 3² × 5 = 180

FAQ

What is the LCM of 8 and 12?
  1. And their HCF is 4. Check: 24 × 4 = 96 = 8 × 12.
Where is LCM used in real life?

When things repeat on different cycles. If one bus comes every 12 minutes and another every 18 minutes, they arrive together every 36 minutes (the LCM).

Where is HCF used?

When dividing things into the largest equal groups. With 12 pens and 18 pencils, you can make at most 6 identical kits (the HCF).