LCM Calculator
Find the least common multiple (LCM) and highest common factor (HCF / GCD) of 2 to 6 numbers — with the prime-factorization steps shown.
How to use
- Enter at least two whole numbers (add up to six with the button).
- Click Calculate LCM & HCF.
- See the LCM, the HCF, and the prime-factorization steps behind them.
Free online math tool.
What Is an LCM Calculator?
The least common multiple (LCM) of two or more numbers is the smallest number that all of them divide into evenly. For 4 and 6, the multiples of 4 are 4, 8, 12, 16… and of 6 are 6, 12, 18… — the first match, 12, is the LCM. This calculator finds the LCM of up to six numbers at once, shows the matching highest common factor (HCF, also called GCD) as a bonus, and — most usefully for students — displays the prime-factorization steps, so you can see exactly where the answer comes from instead of just copying it.
How the Prime Factorization Method Works
Break every number into prime factors: 12 = 2² × 3 and 18 = 2 × 3². For the LCM, take each prime at the highest power it appears anywhere: 2² × 3² = 36. For the HCF, take each prime that appears in every number, at the lowest power: 2¹ × 3¹ = 6. That is the entire method — no listing of multiples, no guesswork — and it scales effortlessly from two numbers to six, which is why it is the method taught for anything beyond small numbers.
Where LCM Shows Up in Real Life
- Adding fractions: the common denominator of 1/4 + 1/6 is LCM(4, 6) = 12 — the single most common classroom use.
- Scheduling: buses every 12 and 18 minutes leave together again after LCM(12, 18) = 36 minutes; the same maths aligns shifts, medication cycles and planetary conjunctions.
- Gears and machines: meshing gears realign after a number of turns given by the LCM of their tooth counts.
- Tiling and packaging: the smallest square a set of rectangles tiles perfectly, or the pack size two products share, is an LCM problem.
LCM vs HCF — and a Handy Check
The two are mirror images: LCM is about multiples (going up), HCF is about divisors (coming down). For exactly two numbers they are linked by a beautiful identity: a × b = LCM(a, b) × HCF(a, b). Check with 12 and 18: 12 × 18 = 216, and 36 × 6 = 216. ✔ (The identity does not hold for three or more numbers, which is why this calculator shows it as a check only when you enter two.)
What is the LCM of 12 and 18?
36. Factorize: 12 = 2² × 3 and 18 = 2 × 3². Take the highest power of each prime: 2² × 3² = 4 × 9 = 36. Indeed 36 ÷ 12 = 3 and 36 ÷ 18 = 2, and no smaller number works — 12, 24 are not divisible by 18, and 18 is not divisible by 12.
Are HCF and GCD the same thing?
Yes — HCF (highest common factor), GCD (greatest common divisor) and GCF (greatest common factor) are three names for the same number: the largest whole number that divides each of your numbers exactly. Different countries and textbooks prefer different names; the mathematics is identical, which is why this calculator labels the result "HCF (GCD)".
What is the LCM if the numbers share no factors?
Then the LCM is simply their product. Numbers with HCF 1 — like 5 and 7, or 8 and 9 — are called co-prime or relatively prime, and LCM(5, 7) = 35, LCM(8, 9) = 72. This is also the fastest mental check: if you cannot find any common factor besides 1, just multiply.
Can the LCM be smaller than the numbers I enter?
Never smaller than the largest of them. The LCM must be a multiple of every number entered, so it is at least as big as the biggest input — and equals it exactly when the largest number is already a multiple of all the others (for example, LCM(4, 8) = 8). The HCF runs the other way: it can never exceed the smallest number entered.