Home › Math › LCM and HCF Calculator

LCM and HCF Calculator

Find the lowest common multiple and highest common factor of two or more numbers, with steps.

Type 2 to 10 whole numbers, separated by commas or spaces. Each number can be up to 12 digits.

Result

Enter two or more numbers to begin.

What are LCM and HCF?

The HCF (highest common factor, also called GCD or greatest common divisor) is the largest number that divides all your numbers exactly. The LCM (lowest common multiple) is the smallest number that all your numbers divide into exactly.

How to use this LCM and HCF calculator

Enter two or more whole numbers and the calculator gives you their HCF and LCM at once. It works for any set of numbers, so you can use it to check homework, simplify fractions or solve word problems quickly.

How to find the HCF and LCM

HCF = common primes with the lowest power
LCM = all primes with the highest power
  • Step 1: Write each number as a product of prime factors.
  • Step 2 (HCF): Multiply the primes that appear in every number, using the smallest power of each.
  • Step 3 (LCM): Multiply every prime that appears in any number, using the biggest power of each.

Worked examples

1. Two numbers: 12 and 18

Their prime factors are 12 = 2² × 3 and 18 = 2 × 3². The common primes with the lowest powers give 2 × 3 = 6, so the HCF is 6. All primes with the highest powers give 2² × 3² = 36, so the LCM is 36.

2. Three numbers: 12, 18 and 24

12 = 2² × 3, 18 = 2 × 3² and 24 = 2³ × 3. The HCF is 2 × 3 = 6. The LCM is 2³ × 3² = 72.

3. The listing method: 4 and 6

Multiples of 4 are 4, 8, 12, 16, 20, 24. Multiples of 6 are 6, 12, 18, 24. The smallest number in both lists is 12, so the LCM is 12. To find an HCF, list the factors instead. The factors of 24 are 1, 2, 3, 4, 6, 8, 12, 24 and the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36. The biggest shared factor is 12.

Euclid's division method for HCF

For large numbers, divide the bigger number by the smaller one and keep dividing the divisor by the remainder until the remainder is 0. The last divisor is the HCF. For 48 and 18:

  • 48 = 2 × 18 + 12
  • 18 = 1 × 12 + 6
  • 12 = 2 × 6 + 0

The HCF is 6, and the LCM is 48 × 18 ÷ 6 = 144.

A useful check for two numbers

HCF × LCM = First number × Second number

For 12 and 18: 6 × 36 = 216, and 12 × 18 = 216. This rule works for two numbers only. For 12, 18 and 24 it fails, since 6 × 72 = 432 but 12 × 18 × 24 = 5,184.

HCF and LCM quick reference

NumbersHCFLCM
8 and 12424
15 and 20560
21 and 28784
14 and 35770
9 and 161144

When the HCF is 1, the numbers are called co-prime, and their LCM is simply their product.

Where are LCM and HCF used?

  • LCM: adding or subtracting fractions with different denominators, and finding when repeating events meet again, such as two buses that leave every 12 and 18 minutes. They leave together again after 36 minutes.
  • HCF: simplifying fractions, and splitting things into the largest equal groups or tiles of the same size. A floor of 450 cm by 360 cm fits square tiles of 90 cm, which is 5 × 4 = 20 tiles.

For 1/12 + 1/18, the LCM of the denominators is 36, so the sum is 3/36 + 2/36 = 5/36. To work with fractions directly, try our Fraction Calculator.

Quick facts to remember

  • The HCF is never bigger than the smallest number, and the LCM is never smaller than the biggest number.
  • The HCF always divides the LCM exactly.
  • If one number is a multiple of the other, the HCF is the smaller number and the LCM is the larger one.

Common mistakes to avoid

  • Mixing up the two. Use the HCF to split into equal parts and the LCM to find when things line up again.
  • Taking the highest power of a prime for the HCF. The HCF uses the lowest power, and the LCM uses the highest.
  • Forgetting a prime that appears in only one number. It must still be included in the LCM.

LCM and HCF calculator FAQs

What is the difference between LCM and HCF?

The HCF is the largest number that divides all the given numbers. The LCM is the smallest number that all the given numbers divide into. The HCF is a factor, while the LCM is a multiple.

Is HCF the same as GCD or GCF?

Yes. HCF, GCD (greatest common divisor) and GCF (greatest common factor) are three names for the same thing.

Can the HCF be bigger than the LCM?

No. The HCF is at most the smallest number and the LCM is at least the biggest number. They are equal only when all the numbers are the same.

What is the LCM of co-prime numbers?

Co-prime numbers have an HCF of 1, so their LCM is their product. For example, the LCM of 9 and 16 is 144.

Can I find the LCM and HCF of more than two numbers?

Yes. Use prime factorisation or apply the method to two numbers at a time. The rule HCF × LCM = product of the numbers works for two numbers only.

What is the HCF of two different prime numbers?

It is 1, because two different primes share no factor other than 1. Their LCM is their product.

Need another calculator?

Browse all calculators
Scroll to Top