Learn · Grades 6–8

How to Find the GCF and LCM of Two Numbers

The greatest common factor (GCF) of two numbers is the largest number that divides both. The least common multiple (LCM) is the smallest number that both divide into. GCF is used to simplify fractions, and LCM to find common denominators.

Try it with your own problem ↓

The steps

  1. GCF: list all the factors of each number.
  2. Circle the factors that are in both lists. The biggest one is the GCF.
  3. LCM: list the first several multiples of each number.
  4. The smallest number in both lists is the LCM.
  5. Check: GCF × LCM = the first number × the second number.

A worked example

Find the GCF and LCM of 12 and 18.

  1. Factors of 12: 1, 2, 3, 4, 6, 12.
  2. Factors of 18: 1, 2, 3, 6, 9, 18.
  3. Shared factors: 1, 2, 3, 6. The greatest is 6.
  4. Multiples of 12: 12, 24, 36, 48, …
  5. Multiples of 18: 18, 36, 54, …
  6. The first number in both lists is 36.
  7. Check: 6 × 36 = 216 and 12 × 18 = 216. ✓

GCF(12, 18) = 6 and LCM(12, 18) = 36.

Try it with your own problem

Open the free The Factor Tree with this example already filled in. It shows every step, and you can type over it with your own numbers.

Work it out: gcf 12 18Opens The Factor Tree with this example

Or try these

Common mistakes

Questions people ask

How do I find the GCF with prime factors?

Write both prime factorizations and multiply the primes they share, the smaller power of each. 12 = 2² × 3 and 18 = 2 × 3², so the GCF is 2 × 3 = 6.

How do I find the LCM with prime factors?

Multiply every prime that appears in either one, using the larger power: 2² × 3² = 36.

What is the GCF of two numbers with nothing in common?

1. Numbers whose GCF is 1 are called relatively prime.

Keep learning

Show The Steps is free, with no accounts or ads, and everything is worked out in your own browser. Start at the home page.