LCM & HCF Calculator
Find the Least Common Multiple and Highest Common Factor with step-by-step prime factorization.
Prime Factorization of Each Number
| Number | 2 | 3 |
|---|---|---|
| 12 | 2² | 3 |
| 18 | 2 | 3² |
Understanding LCM & HCF
What is HCF (GCD)?
The Highest Common Factor is the largest number that divides all given numbers exactly. Use it to simplify fractions or split items into the largest equal groups.
What is LCM?
The Least Common Multiple is the smallest number that is a multiple of all given numbers. Essential for adding fractions with different denominators.
When events repeat together
If a bus arrives every 12 minutes and another every 18 minutes, LCM(12, 18) = 36 means they arrive together every 36 minutes.
Key identity (two numbers)
For any two numbers a and b:
LCM(a, b) × HCF(a, b) = a × b
What is LCM & HCF Calculator?
The LCM and HCF calculator finds the Least Common Multiple (LCM) and Highest Common Factor (HCF) — also called the Greatest Common Divisor (GCD) — for up to eight numbers at once, while showing the complete prime factorisation working for each input number.
The Highest Common Factor of a set of numbers is the largest integer that divides all of them without a remainder. The Least Common Multiple is the smallest positive integer that is divisible by all of them. These two values are fundamental in number theory and appear constantly in school mathematics: simplifying fractions requires the HCF, adding fractions with different denominators requires the LCM, and both appear throughout algebra, combinatorics, and cryptography.
This tool goes beyond just producing a numerical answer. It factorises each input into its prime components, displays the factor trees, and then walks through the LCM and HCF derivation step by step — identifying shared prime factors and applying the correct algorithm. This makes it an excellent learning tool for students studying prime factorisation for the first time, as well as a quick reference for anyone who needs to verify a result or check their working method.
How to Use LCM & HCF Calculator
- Enter your numbers
Type up to 8 positive integers into the input fields. Add or remove fields as needed using the plus and minus buttons.
- Calculate LCM and HCF
Click Calculate to compute both the LCM and HCF for the entire set of numbers simultaneously.
- Review prime factorisation
See each number broken down into its prime factors, displayed as a factor tree or factor notation.
- Follow the step-by-step working
Read through the derivation showing how shared and unshared prime factors are combined to produce the LCM and HCF.
Key Benefits
Find the LCM and HCF for a whole set of numbers in one calculation, not just pairs.
Every input is broken into its prime factors with full working, helping students learn the method as well as the answer.
Both results are calculated simultaneously, saving time when you need both values for a fraction or algebra problem.
Results appear immediately in your browser — no account, no ads-to-dismiss, no delay.
Frequently Asked Questions
They are the same thing. HCF (Highest Common Factor) is the term more commonly used in UK and Indian curricula, while GCD (Greatest Common Divisor) is more common in US and European contexts. The calculation and result are identical.
The tool uses prime factorisation to find the HCF for display purposes, and internally uses the Euclidean algorithm for efficiency when dealing with large numbers. Both methods produce the same result.
LCM and HCF are defined for positive integers only. Enter whole positive numbers only. For decimal inputs, you would first need to convert them to integers (e.g. multiply through to remove the decimal point).
Two distinct prime numbers share no common factors other than 1, so their HCF is 1. Since LCM = (a × b) / HCF(a, b), when HCF is 1 the LCM equals the product. For example, LCM(7, 11) = 77.