Greatest common divisor (GCD)

6

Least common multiple (LCM): 36

LCM = (first number ÷ GCD) × second number

How it works

The GCD is the largest whole number that divides evenly into both numbers, found using the Euclidean algorithm.

The LCM is the smallest whole number that both numbers divide evenly into, found from the GCD: (first number ÷ GCD) × second number.

Formula: LCM = (first number ÷ GCD) × second number

Examples

Two numbers with common factors

12 and 18 have a GCD of 6 and an LCM of 36.

Two coprime numbers

4 and 7 share no common factor other than 1, so their GCD is 1 and their LCM is their product, 28.

Things to keep in mind

  • Both numbers must be positive whole numbers.
  • "HCF" (highest common factor) is another name for the same thing as GCD — the two terms are used in different regions for an identical calculation.

Frequently asked questions

What is the difference between GCD and HCF?

Nothing — GCD (greatest common divisor) and HCF (highest common factor) are two names for exactly the same calculation.

How is the LCM related to the GCD?

Once you know the GCD, the LCM is (first number ÷ GCD) × second number. For 12 and 18, that is (12 ÷ 6) × 18 = 36.