Greatest common factor (GCF) and least common multiple (LCM) are two of the most confused ideas in middle-school math. They look similar, they share numbers, and they are both about divisibility — but they solve opposite problems. Once you see the difference, word problems get much easier.

The one-sentence difference

GCF is the biggest number that divides into both values. LCM is the smallest number that both values divide into.

GCF lives at or below the smaller number. LCM lives at or above the larger number. If you remember that geometry, you will rarely confuse them.

Calculating the GCF

For 12 and 18:

  1. List factors of 12: 1, 2, 3, 4, 6, 12
  2. List factors of 18: 1, 2, 3, 6, 9, 18
  3. Find the largest shared factor: 6

For larger numbers, use prime factorization. 12 = 2² × 3. 18 = 2 × 3². Take the lowest power of each shared prime: 2¹ × 3¹ = 6.

Or use the Euclidean algorithm: GCF(18, 12) = GCF(12, 6) = GCF(6, 0) = 6. Divide the larger by the smaller, replace the larger with the remainder, repeat until the remainder is 0.

Calculating the LCM

For 12 and 18:

  1. List multiples of 12: 12, 24, 36, 48, 60, ...
  2. List multiples of 18: 18, 36, 54, 72, ...
  3. Find the smallest shared multiple: 36

By prime factorization: take the highest power of each prime. 12 = 2² × 3. 18 = 2 × 3². So LCM = 2² × 3² = 36.

The beautiful shortcut

For any two positive integers, GCF × LCM = product of the two numbers.

Check: GCF(12, 18) × LCM(12, 18) = 6 × 36 = 216 = 12 × 18. ✓

So if you already know one, you can find the other in one multiplication and one division. This is a huge time saver on tests.

How to tell which one the problem wants

Word problems almost always drop clues. Look for these patterns:

GCF problems (reducing or dividing evenly)

  • "What is the largest group size so that..."
  • "Simplify the fraction 18/24" (GCF = 6; simplifies to 3/4)
  • "Cut ribbons of equal length with no waste"
  • "Arrange items into equal rows"

If the problem is about splitting things down to equal parts, it wants GCF.

LCM problems (meeting up or aligning)

  • "When will both events happen again at the same time?"
  • "The red light blinks every 4 seconds, the green every 6..."
  • "Find a common denominator"
  • "Buy hot dogs (10 per pack) and buns (8 per pack) so none are leftover"

If the problem is about combining schedules or repeating cycles, it wants LCM.

A worked word problem

You have 24 apples and 36 oranges. You want to pack them into identical gift bags, each with the same mix, with no fruit left over. What is the largest number of bags you can make?

This is a division problem. Both fruit counts must split evenly into the number of bags. You want the largest such number — that is GCF(24, 36) = 12. Each bag gets 2 apples and 3 oranges.

Now: Bus A leaves every 15 minutes, Bus B every 20. If they both leave at 8:00 AM, when do they next leave together? You need a time that is a multiple of both — specifically the smallest one. LCM(15, 20) = 60. They next leave together at 9:00 AM.

Why both matter in fractions

GCF simplifies fractions: divide top and bottom by GCF(numerator, denominator).

LCM adds and subtracts fractions: find LCM of the denominators, convert each fraction to use that common denominator, then add or subtract numerators.

Most fraction pain in school is really GCF/LCM pain in disguise.

Three-number versions

For GCF of three numbers, pair them: GCF(a, b, c) = GCF(GCF(a, b), c). LCM works the same way.

For 8, 12, 20: GCF(8, 12) = 4, then GCF(4, 20) = 4. And LCM(8, 12) = 24, then LCM(24, 20) = 120.

Speed it up

Our GCF and LCM calculator handles two or more numbers in one click and shows the prime factorization behind the answer. Use it to check homework, plan projects, or simplify tough fractions. And keep the geometry in mind: GCF shrinks, LCM stretches. That alone settles most doubts.