LCM & HCF calculator
Enter any list of whole numbers and get both the lowest common multiple and the highest common factor, along with each number's prime factorisation so you can see where the answer comes from.
How to use the lcm & hcf calculator
- Type your numbers separated by commas or spaces.
- Read the LCM and HCF.
- Check the prime factorisations underneath if you need to show your working.
How it works
The HCF, also called the GCD, is the largest number that divides every value in the list, and it is found with Euclid's algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until nothing is left over. The LCM follows from the relationship LCM(a,b) × HCF(a,b) = a × b, applied one pair at a time down the list.
Prime factorisation gives the same answers a different way: the HCF takes the lowest power of each shared prime, and the LCM takes the highest power of every prime that appears. For 12 = 2²×3 and 18 = 2×3², the HCF is 2×3 = 6 and the LCM is 2²×3² = 36.
Common questions
What is the difference between LCM and HCF?
HCF is the largest number that divides them all; LCM is the smallest number they all divide into. HCF is never larger than your smallest input, LCM never smaller than your largest.
What does coprime mean?
Two numbers are coprime when their HCF is 1 — they share no factor above one, like 8 and 15.
Is GCD the same as HCF?
Yes. Greatest common divisor and highest common factor are two names for the same thing.