LCM and HCF Calculator
Calculators · Added
Enter two or more whole numbers and this calculator returns the highest common factor and the lowest common multiple, together with the prime factorisation of each number. The working is the point: both answers are read off the same table of prime powers, and seeing that table is what turns a remembered procedure into something you can check.
How to use the lcm and hcf calculator
- 1Type the numbers into the box, separated by commas, spaces or new lines. Two to twelve of them.
- 2Press Find HCF and LCM, or pick one of the example sets to see the working immediately.
- 3Read the two headline answers, then the factorisation table underneath that produced them.
- 4Check the HCF and LCM rows: they show which prime powers were taken, using the lowest power for the HCF and the highest for the LCM.
- 5Use Copy working to put the numbers, both answers and every factorisation on your clipboard.
Examples
The textbook pair
- Input
- 12, 18
- Result
- HCF 6, LCM 36
12 = 2² × 3 and 18 = 2 × 3². Lowest powers give 2 × 3 = 6; highest powers give 2² × 3² = 36.
Three numbers at once
- Input
- 24, 36, 60
- Result
- HCF 12, LCM 360
Note that 12 × 360 is 4,320 while the three numbers multiply to 51,840 — the HCF × LCM identity applies to two numbers only.
Numbers with nothing in common
- Input
- 8, 9
- Result
- HCF 1, LCM 72
An HCF of 1 means the numbers are coprime, and the LCM is then simply their product.
About the lcm and hcf calculator
Why prime factorisation is worth the extra step
There are quicker ways to get an HCF. Euclid's algorithm finds it in a handful of divisions and is what the tool actually runs, because it is fast even on numbers with a trillion digits' worth of range. What it does not give you is any sense of why the answer is what it is: you get a number, and if you have mistyped an input you get a different number with equal confidence.
The factorisation table is the check. Two numbers that share a factor of 6 will visibly share a 2 and a 3, and if you expected them to share more, the table shows you exactly which prime is missing from which number. That makes it possible to catch a typo in the input rather than in the answer, which is the more useful place to catch it.
It also makes the LCM comprehensible. The rule 'take the highest power of each prime' sounds arbitrary until you can see that the LCM must contain enough of each prime to be divisible by every input, and no more than that if it is to be the smallest such number.
Coprime numbers, and the shortcut they allow
When the HCF is 1 the numbers are coprime: they share no prime factor at all. This is worth noticing because the LCM then collapses to a multiplication — 8 and 9 are coprime, so their LCM is simply 72. It is why fraction addition is easy when the denominators are coprime and awkward when they are not.
Coprimality does not require either number to be prime. 8 and 9 are both composite, and 15 and 28 are coprime while sharing no factor beyond 1. What matters is only that their factorisations have no prime in common, which the table on this page makes visible at a glance.
The property matters well beyond schoolwork. Public-key cryptography depends on choosing exponents coprime to a particular product, and the ordinary business of reducing a ratio to its simplest form is the same test applied to two numbers you want to describe as compactly as possible.
Frequently asked questions
What is the difference between HCF, GCD and GCF?
How do I find the LCM by hand?
Is it true that HCF × LCM equals the product of the numbers?
How large can the numbers be?
What are LCM and HCF actually used for?
Related tools
Fraction Calculator
Calculators
Add, subtract, multiply and divide fractions and mixed numbers, with exact results.
Ratio Calculator
Calculators
Simplify a ratio, share an amount in proportion, or solve for a missing term.
Scientific Calculator
Calculators
A full scientific calculator with trigonometry, logarithms, powers and memory keys.