LCM Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free LCM calculator. Find the least common multiple and the greatest common factor (GCF or HCF) of two or more whole numbers, of any size.

LCM
0
GCF (HCF)
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the LCM calculator

  1. Type two or more whole numbers, separated by commas or spaces, such as 12, 18, 30.
  2. Read the answer. The LCM calculator shows the least common multiple (LCM) and the greatest common factor (GCF, also called the highest common factor or HCF) of all the numbers at once.

You can enter up to 100 numbers, and they can be as long as you like. The LCM calculator uses exact whole-number arithmetic, so even 30-digit numbers give a precise answer rather than a rounded one.

What the LCM is

The least common multiple of a set of numbers is the smallest positive number that every one of them divides into exactly.

The multiples of 4 are 4, 8, 12, 16, 20, 24… and the multiples of 6 are 6, 12, 18, 24… The first number in both lists is 12, so the LCM of 4 and 6 is 12.

For 12, 18 and 30, the LCM is 180: 180 ÷ 12 = 15, 180 ÷ 18 = 10 and 180 ÷ 30 = 6, and no smaller number works for all three.

What the GCF is

The greatest common factor is the opposite idea: the largest number that divides into every number in the set. For 12, 18 and 30, the factors they share are 1, 2, 3 and 6, so the GCF is 6.

If the GCF of two numbers is 1, they're called coprime (or relatively prime): they share no factor at all. 8 and 15 are coprime, even though neither is prime.

How the LCM calculator works it out

The GCF uses Euclid's algorithm, one of the oldest algorithms in maths. Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder until the remainder is zero. The last non-zero remainder is the GCF.

For 48 and 18: 48 ÷ 18 leaves 12; 18 ÷ 12 leaves 6; 12 ÷ 6 leaves 0. So the GCF is 6.

The LCM uses the GCF. For two numbers:

LCM(a, b) = a × b ÷ GCF(a, b)

For 48 and 18: 48 × 18 ÷ 6 = 144. For three or more numbers, the LCM calculator applies the rule step by step: LCM(a, b, c) = LCM(LCM(a, b), c). This is fast even for huge numbers, much faster than listing multiples.

Using prime factors instead

The method most schools teach is prime factorisation:

  • 12 = 2² × 3
  • 18 = 2 × 3²
  • 30 = 2 × 3 × 5

For the LCM, take the highest power of every prime that appears: 2² × 3² × 5 = 4 × 9 × 5 = 180.

For the GCF, take the lowest power of every prime that appears in all of them: 2 × 3 = 6.

Both methods always agree. To see the prime factors of any number, use the prime factorization calculator.

Where LCM and GCF are used

Adding fractions. The lowest common denominator of 1/12 + 1/18 is the LCM of 12 and 18, which is 36. So 1/12 + 1/18 = 3/36 + 2/36 = 5/36. The fraction calculator does this automatically.

Simplifying fractions and ratios. Divide the top and bottom by their GCF: 48/18 becomes 8/3. The ratio calculator does the same for ratios.

Schedules that line up. If one bus comes every 12 minutes and another every 18, they leave together every 36 minutes (their LCM). If a shop restocks bread every 4 days and milk every 6 days, both arrive on the same day every 12 days.

Packaging and buying. Hot dogs in packs of 10 and buns in packs of 8: the smallest number you can buy with none left over is LCM(10, 8) = 40, which is 4 packs of hot dogs and 5 packs of buns.

Dividing into equal groups. If you have 45 apples and 60 oranges and want to make identical gift bags with nothing left over, the most bags you can make is GCF(45, 60) = 15, each with 3 apples and 4 oranges.

Tiling and cutting. The largest square tile that fits a 120 cm × 84 cm area exactly has a side equal to GCF(120, 84) = 12 cm.

Gears and cycles. Two gears with 45 and 60 teeth come back to their starting position together after LCM(45, 60) = 180 teeth have passed, which is 4 turns of the small gear and 3 of the large one.

A useful check

For any two numbers:

LCM(a, b) × GCF(a, b) = a × b

For 45 and 60: 180 × 15 = 2,700, and 45 × 60 = 2,700. The LCM calculator reminds you of this check whenever you enter exactly two numbers. (It doesn't hold for three or more numbers.)

Tips

  • Zero isn't allowed. Every number divides 0, so the LCM would be 0 and meaningless. The LCM calculator asks for numbers above zero.
  • Only whole numbers. For decimals, scale them up first (0.5 and 0.75 become 50 and 75).
  • The LCM is never smaller than the largest number, and the GCF is never bigger than the smallest.
  • If one number divides all the others, it's the GCF; if all the others divide one number, that's the LCM.

Privacy and accuracy

Your numbers stay in your browser; nothing is uploaded. The LCM calculator uses exact big-integer arithmetic with Euclid's algorithm, no rounding and no AI, so the answer is always exact and always the same. Students, teachers, parents and anyone planning schedules use it on any device, free and without signing up.

LCM and GCF of larger sets

With three or more numbers, it helps to see how the LCM grows. For 4, 6, 8, 10 and 12:

  • LCM(4, 6) = 12
  • LCM(12, 8) = 24
  • LCM(24, 10) = 120
  • LCM(120, 12) = 120

The result is 120. The GCF of the same set is 2, because 2 is the only number above 1 that divides all five. The LCM calculator handles up to 100 numbers this way in one go.

Why the LCM can get very large

The LCM of numbers that share no factors is their product, so it can grow fast. The LCM of 1 to 10 is 2,520, but the LCM of 1 to 20 is 232,792,560, and the LCM of 1 to 40 has 16 digits. Ordinary calculators lose precision with numbers that big. The LCM calculator uses exact big-integer arithmetic, so every digit is correct.

Practice questions

  1. Find the LCM and GCF of 15 and 25. (LCM 75, GCF 5)
  2. Two runners lap a track in 6 and 8 minutes. When will they next be at the start together? (24 minutes)
  3. What is the largest number of identical bags you can make from 24 pens and 36 pencils with none left over? (12 bags)

Type each into the LCM calculator to check your answers.

Quick reference

  • Multiple: a number times a whole number. Multiples of 6 are 6, 12, 18, 24…
  • Factor (divisor): a number that divides another exactly. Factors of 12 are 1, 2, 3, 4, 6 and 12.
  • Common multiple: a multiple shared by two or more numbers.
  • LCM: the smallest common multiple.
  • GCF / HCF / GCD: the largest common factor.
  • Coprime: two numbers whose GCF is 1.

Whatever the question calls them, the LCM calculator gives both answers at once.

A worked example

A parent is helping with homework: "Find the LCM and HCF of 8, 12 and 20." They type 8, 12, 20 into the LCM calculator, which shows LCM = 120 and GCF = 4.

To check it the school way, they write the prime factors: 8 = 2³, 12 = 2² × 3, 20 = 2² × 5. The highest powers are 2³, 3 and 5, so the LCM is 8 × 3 × 5 = 120. The prime shared by all three is 2, at its lowest power 2², so the HCF is 4. The answer matches.

The next question asks when three lighthouses that flash every 8, 12 and 20 seconds will flash together again: after 120 seconds, which is 2 minutes.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.

Frequently asked questions

How do I find the LCM of two numbers?

Multiply them and divide by their greatest common factor. For 6 and 8: 48 ÷ 2 = 24. The LCM calculator works for any number of values.

What's the difference between LCM and GCF?

The LCM is the smallest number they all divide into; the GCF is the largest number that divides all of them.

Is HCF the same as GCF?

Yes. Highest common factor (HCF), greatest common factor (GCF) and greatest common divisor (GCD) all mean the same thing.

What is the LCM of two prime numbers?

Their product, because they share no factors. The LCM of 7 and 11 is 77.

Can the LCM calculator handle very large numbers?

Yes. It uses exact integer arithmetic, so numbers with dozens of digits work.

Is this LCM calculator free?

Yes. It's free, has no limits and needs no account.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep