LCM & HCF

LCM and HCF Calculator

Find the LCM and HCF (GCD) of two or more numbers, with the prime factorisation and working shown step by step.

HCF (greatest common divisor)
LCM (lowest common multiple)

Prime factorisation of each

How they combine

The HCF takes the lowest power of every prime the numbers share; the LCM takes the highest power of every prime that appears in any of them. That single difference is the whole distinction.

Last updated 28 August 2026

Two answers from one factorisation

Break each number into primes and both results are sitting there. For the highest common factor, take every prime that appears in all of them and use the lowest power any of them has — that is the largest number dividing into all of them. For the lowest common multiple, take every prime that appears anywhere and use the highest power — that is the smallest number they all divide into. The relationship between them is exact for two numbers: their HCF times their LCM equals their product, which is why finding one immediately gives you the other. For longer lists the calculation chains, folding the running answer against each new number in turn.

Common questions

What is the difference between HCF, GCD and GCF?

Nothing — they are three names for the same thing. Highest common factor, greatest common divisor and greatest common factor all mean the largest number that divides into every number in the set.

Is there a shortcut for two numbers?

Yes. For any two numbers, HCF × LCM equals their product. So once you have one, dividing the product by it gives the other. This holds only for pairs, not for longer lists.

What happens if I include zero?

Zero is skipped. Every number divides zero, so including it makes the HCF meaningless and the LCM zero — neither of which is a useful answer, so the tool ignores it and works with the rest.

Can it handle more than two numbers?

Yes, as many as you like. Both results are built up by folding the running answer against each number in turn, which gives the same result as factorising them all at once.

The other tools