LCM & HCF Calculator (with Steps)
Enter two or more positive whole numbers separated by commas or spaces to get the HCF (GCD), LCM, prime factors and the Euclidean algorithm steps.
What are HCF and LCM?
HCF (Highest Common Factor, also called GCD) is the largest number that divides all the given numbers exactly. LCM (Least Common Multiple) is the smallest number that all of them divide into exactly.
Methods
- Prime factorization: write each number as a product of primes. HCF takes the lowest power of each common prime; LCM takes the highest power of every prime.
- Euclid's algorithm: replace the larger number by the remainder of dividing it by the smaller, until the remainder is 0. The last divisor is the HCF.
- Link between them: for two numbers, HCF × LCM = the product of the numbers.
Example
For 12 and 18: 12 = 2² × 3 and 18 = 2 × 3². HCF = 2 × 3 = 6. LCM = 2² × 3² = 36. Check: 6 × 36 = 216 = 12 × 18.
Also handy: the fraction calculator, which uses HCF to simplify answers.
FAQ
How do I find the HCF of two numbers?
Use Euclid's algorithm: divide the larger by the smaller, then repeat with the remainder until it is 0. The last non-zero remainder is the HCF.
How do I find the LCM?
For two numbers, LCM = (a × b) ÷ HCF. For more numbers, find the LCM of two, then with the next, and so on.
Is HCF the same as GCD?
Yes. HCF, GCD (greatest common divisor) and GCF (greatest common factor) mean the same thing.
Can I use decimals or negatives?
No. Use positive whole numbers only.