A notebook showing two numbers broken into prime factors to find their GCF and LCM
Math · 7 min read

How to find the GCF and LCM

The greatest common factor (GCF) is the biggest number that divides two numbers evenly; the least common multiple (LCM) is the smallest number they both divide into. Here is how to find each by listing, by prime factors and by the division method, with worked examples and the uses that really come up.

Do the mathsGCF & LCM Calculator

Find the greatest common factor and least common multiple of two numbers.

The greatest common factor (GCF) and the least common multiple (LCM) are two sides of the same idea, and mixing them up is the most common slip. The GCF is the biggest number that divides evenly into all of your numbers; the LCM is the smallest number that all of your numbers divide evenly into. One breaks numbers down, the other builds them up. This guide shows three ways to find each, a shortcut that links them, and the places they genuinely come up, from simplifying fractions to lining up schedules. The two are easy to tell apart once you notice the GCF is never bigger than your smallest number, while the LCM is never smaller than your biggest.

What GCF and LCM actually mean

A factor of a number divides into it with nothing left over: the factors of 12 are 1, 2, 3, 4, 6 and 12. A multiple is the number times 1, 2, 3 and so on: the multiples of 12 are 12, 24, 36, 48 and so on. The greatest common factor of two numbers is the largest factor they share, and the least common multiple is the smallest multiple they share. The GCF is also called the greatest common divisor (GCD) or highest common factor (HCF), and the LCM the lowest common multiple. Different names, same two numbers.

How to find the GCF by listing

For small numbers, listing works and makes the idea concrete. Write out every factor of each number, then pick the biggest one they both have.

Take 12 and 18. The factors of 12 are 1, 2, 3, 4, 6, 12. The factors of 18 are 1, 2, 3, 6, 9, 18. The factors they share are 1, 2, 3 and 6, and the greatest of those is 6. So the GCF of 12 and 18 is 6. That means 6 is the largest number that divides both without a remainder, which is exactly what you need when you want to split two amounts into the biggest equal groups.

How to find the LCM by listing

For the LCM, list the multiples of each number instead, and stop at the first one that appears in both lists.

Take 4 and 6. Multiples of 4: 4, 8, 12, 16, 20. Multiples of 6: 6, 12, 18, 24. The first number in both lists is 12, so the LCM of 4 and 6 is 12. Note it is not 24 (the product of 4 and 6): the LCM is the smallest shared multiple, and here 12 gets there first because 4 and 6 already share a factor of 2. The product only equals the LCM when the two numbers share no factors.

The prime factorization method (for bigger numbers)

Listing gets slow once numbers grow, and the reliable method is prime factorization: break each number into the primes that multiply to make it, then read both answers off.

Take 48 and 36. In prime factors, 48 = 2⁴ × 3 and 36 = 2² × 3². Now two simple rules: for the GCF, take each shared prime to its lowest power; for the LCM, take every prime that appears to its highest power. The shared primes are 2 and 3. Lowest powers: 2² and 3¹, so GCF = 2² × 3 = 4 × 3 = 12. Highest powers across both: 2⁴ and 3², so LCM = 2⁴ × 3² = 16 × 9 = 144. This method never gets lost, however large the numbers, because you are only ever comparing powers of the same prime.

The division (ladder) method

If you would rather not factor fully, the ladder method does both at once. Write two numbers side by side, divide both by any prime that goes into both, and keep going until the numbers at the bottom share no factor. Using 48 and 36: divide by 2 to get 24 and 18; by 2 again to get 12 and 9; by 3 to get 4 and 3. Now 4 and 3 share nothing, so stop. The GCF is the product of the primes you divided by on the left (2 × 2 × 3 = 12), and the LCM is that GCF times the two numbers left at the bottom (12 × 4 × 3 = 144). Same answers, less writing. (For three or more numbers the ladder needs extra care, so prime factorization is the safer method there.)

The GCF and LCM shortcut (and its one limit)

For two numbers there is a neat relationship worth knowing: GCF × LCM = the product of the two numbers. Check it on 12 and 18: GCF 6 times LCM 36 is 216, and 12 × 18 is also 216. So if you have found one, you can get the other for free: LCM = (the two numbers multiplied) ÷ GCF. For 48 and 36 that is (48 × 36) ÷ 12 = 1728 ÷ 12 = 144, matching above. The one limit: this shortcut only works for exactly two numbers. With three or more it breaks: for 12, 18 and 30 the GCF is 6 and the LCM is 180, so 6 × 180 = 1,080, but 12 × 18 × 30 = 6,480, and the two no longer match. The rule also makes coprime numbers easy: 8 and 15 share no factor, so their GCF is 1 and their LCM is simply 8 × 15 = 120.

Three or more numbers

The prime-factor rules extend cleanly to any count of numbers. Take 12, 18 and 30: that is 2² × 3, then 2 × 3², then 2 × 3 × 5. For the GCF, take each prime shared by all three at its lowest power: both 2 and 3 appear in all three, lowest powers 2¹ and 3¹, so GCF = 2 × 3 = 6. For the LCM, take every prime that appears anywhere at its highest power: 2², 3² and 5, so LCM = 4 × 9 × 5 = 180. The 5 counts for the LCM even though only one number has it, because the LCM must be divisible by all three.

Where GCF and LCM actually get used

These are not just exam questions. The GCF is how you simplify a fraction: dividing the top and bottom of 18/24 by their GCF of 6 gives 3/4 in one step. It is also how you simplify a ratio to its smallest whole numbers, and how you split two quantities into the largest equal groups, say arranging 48 red and 36 blue items into identical kits with none left over (12 kits).

The LCM is what gives you a common denominator for adding fractions: to add 1/4 and 1/6 you use the LCM of 4 and 6, which is 12, rewrite them as 3/12 and 2/12, and add to get 5/12. It also answers "when do two cycles line up again" problems: a bus every 12 minutes and another every 18 minutes both leave together again after LCM(12, 18) = 36 minutes.

Common mistakes

Break each number into primes, take lowest powers for the GCF and highest powers for the LCM, and the two stop being confusable. When you want them worked out instantly, including for several numbers at once, the free GCF and LCM calculator shows both with the factors, the fraction calculator uses them to simplify and add fractions, and the ratio calculator uses the GCF to reduce a ratio.

Frequently asked questions

What is the difference between GCF and LCM?

The GCF (greatest common factor) is the largest number that divides evenly into all your numbers, so it is never bigger than the smallest of them. The LCM (least common multiple) is the smallest number they all divide into, so it is never smaller than the largest of them. The GCF breaks numbers down; the LCM builds them up.

How do I find the GCF of two numbers?

List the factors of each and take the biggest they share, or for larger numbers use prime factorization: write each as a product of primes and multiply the shared primes at their lowest power. For 12 = 2² × 3 and 18 = 2 × 3², the shared primes give 2 × 3 = 6, so the GCF is 6.

How do I find the LCM of two numbers?

List the multiples of each and take the first they share, or use prime factorization: take every prime that appears at its highest power. For 4 = 2² and 6 = 2 × 3, that is 2² × 3 = 12, so the LCM is 12. You can also use LCM = (the two numbers multiplied) ÷ their GCF.

Is there a relationship between the GCF and the LCM?

Yes, for two numbers: GCF × LCM equals the product of the two numbers. So if you know one, you can find the other. For 12 and 18, GCF 6 × LCM 36 = 216 = 12 × 18. This shortcut works only for two numbers; for three or more, use prime factorization instead.

Why is the LCM not always the two numbers multiplied?

The product equals the LCM only when the numbers share no common factor. When they do share one, the LCM is smaller, because the shared factor is counted once rather than twice. For 4 and 6, the product is 24 but the LCM is 12, since they share a factor of 2.

What are GCF and LCM used for?

The GCF simplifies fractions and ratios to their lowest terms and splits quantities into the largest equal groups. The LCM gives the common denominator for adding fractions and solves when-do-cycles-line-up problems, like two buses on 12- and 18-minute timetables leaving together again after 36 minutes.

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the same number: the largest value that divides all your numbers evenly. In the same way, the LCM is also called the lowest common multiple. The names differ by country and textbook, but the method and the answer are identical.

Calculators in this article

GCF & LCM Calculator

Find the greatest common factor and least common multiple of two numbers.

Open

Fraction Calculator

Add, subtract, multiply or divide two fractions, simplified automatically.

Open

Ratio Calculator

Simplify a ratio and solve a proportion in one place.

Open