All guides

Greatest Common Divisor and Lowest Common Multiple Explained

What the GCD and LCM mean

The greatest common divisor, or GCD, is the largest number that divides exactly into two or more numbers. The lowest common multiple, or LCM, is the smallest number that is a multiple of two or more numbers. For 12 and 18, the divisors of 12 are 1, 2, 3, 4, 6 and 12, and the divisors of 18 are 1, 2, 3, 6, 9 and 18. The common divisors are 1, 2, 3 and 6, so the GCD is 6. The multiples of 12 are 12, 24, 36, 48 and 60, and the multiples of 18 are 18, 36, 54 and 72. The first multiple they share is 36, so the LCM is 36. The GCD is used when you want to split things into the largest equal groups, and the LCM is used when you want to find when things line up again or to find a common denominator.

How to find the GCD and LCM

The listing method works well for small numbers. List the factors of each number to find the GCD, and list the multiples of each number to find the LCM. For larger numbers, use prime factorisation. Write each number as a product of prime numbers. For 24, the prime factors are 2 times 2 times 2 times 3. For 36, they are 2 times 2 times 3 times 3. The GCD uses the prime factors that appear in both numbers, taking the smallest count of each. Both numbers have two 2s and one 3 in common, so the GCD is 2 times 2 times 3, which is 12. The LCM uses every prime factor, taking the largest count of each. That gives three 2s and two 3s, so the LCM is 2 times 2 times 2 times 3 times 3, which is 72.

When to use each one

Use the GCD when you are dividing things into equal groups as large as possible. For example, if you have 24 red pens and 36 blue pens and you want packs with the same number of each colour and no pens left over, the GCD of 24 and 36 is 12, so you can make 12 packs, each with 2 red pens and 3 blue pens. Use the LCM when you need a common denominator for fractions, or when two repeating events line up. For example, if one bus leaves every 12 minutes and another leaves every 18 minutes, and they leave together now, they will leave together again after the LCM of 12 and 18, which is 36 minutes. To add 1/12 and 1/18, use the LCM 36 as the common denominator: 1/12 is 3/36 and 1/18 is 2/36, so the sum is 5/36.

Try it on your own numbers

The free calculator that goes with this guide:

Try the GCD and LCM calculator