How to use the LCM and HCF Calculator
- Type 2 to 10 whole numbers separated by commas or spaces, for example 12, 18, 30.
- Read the HCF (GCD) and LCM at once. They update as you type, and very large numbers stay exact.
- Use the prime-factor table: HCF takes the lowest power of each prime, and LCM takes the highest.
- Follow the common division method for the LCM and Euclid's algorithm for the HCF, the steps your textbook asks you to show.
HCF and LCM in one line each
The HCF (highest common factor), also called the GCD (greatest common divisor) or GCF, is the largest number that divides every number in the list. The LCM (least common multiple) is the smallest positive number that every number in the list divides. For 12, 18 and 30, the HCF is 6 and the LCM is 180.
This calculator handles 2 to 10 whole numbers of up to 30 digits each. It uses exact big-integer (BigInt) arithmetic, so there is no rounding even when the LCM runs to dozens of digits. It shows the three methods taught in school, so you can match whichever one your textbook uses.
Method 1: prime factorisation
Write each number as a product of primes. Then:
Worked example: 12, 18 and 30
- 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5
- HCF: 2 appears with powers 2, 1, 1, so take 2¹. 3 appears with powers 1, 2, 1, so take 3¹. 5 is not common. HCF = 2 × 3 = 6.
- LCM: highest powers are 2², 3² and 5¹, so LCM = 4 × 9 × 5 = 180.
This is the method used in the NCERT Class 10 chapter on Real Numbers. It relies on the Fundamental Theorem of Arithmetic, which says every number has exactly one prime factorisation. You can explore single numbers in depth with the prime factorization calculator.
Method 2: common division method
Write the numbers in a row. Divide by a prime that divides at least one of them, write the quotients below, and bring down any number it does not divide. Repeat until every entry is 1. The LCM is the product of all the divisors on the left. For 12, 18 and 30 the divisors are 2, 2, 3, 3 and 5, so the LCM is 2 × 2 × 3 × 3 × 5 = 180.
Method 3: Euclid's division algorithm
Euclid's division lemma says that for positive integers a and b there are unique whole numbers q and r with
HCF(a, b) = HCF(b, r), so keep dividing the previous divisor by the remainder until the remainder is 0. The last non-zero divisor is the HCF. For 455 and 42:
Euclid's method needs no factorisation at all, which is why it stays fast for 30-digit numbers. For three or more numbers, apply it in pairs: HCF(a, b, c) = HCF(HCF(a, b), c).
The HCF × LCM relation (two numbers only)
For 96 and 404: HCF = 4 and LCM = 9696, and 4 × 9696 = 38,784 = 96 × 404. It is the quickest way to find an LCM once you know the HCF. It does not hold for three or more numbers in general. For 12, 18 and 30, HCF × LCM = 6 × 180 = 1080, but 12 × 18 × 30 = 6480. The calculator flags this whenever you enter more than two numbers.
Quick reference
| Situation | HCF | LCM |
|---|---|---|
| Co-prime numbers, e.g. 17 and 23 | 1 | The product, 391 |
| One number divides the other, e.g. 6 and 24 | The smaller, 6 | The larger, 24 |
| Two different primes p and q | 1 | p × q |
| Any list | Divides every number | A multiple of every number |
Common mistakes and exam tips
- Swapping lowest and highest powers. HCF uses the lowest power of common primes. LCM uses the highest power of every prime.
- Using HCF × LCM = product for three numbers. It only works for two.
- Remember the checks. The HCF always divides the LCM, the HCF is at most the smallest number, and the LCM is at least the largest.
- Word problems. "Largest size that fits exactly" or "greatest number that divides" means HCF. "Bells ring together again" or "smallest number divisible by" means LCM.
- Adding fractions uses the LCM of the denominators. Try the fraction calculator.
Frequently asked questions
What is the difference between HCF and LCM?
Is HCF the same as GCD?
Does HCF × LCM = product work for three numbers?
How do you find the HCF using Euclid's division algorithm?
What is the HCF and LCM of two co-prime numbers?
Can the HCF be larger than the LCM?
Last reviewed November 2026. Results are estimates for information only — see our disclaimer.