GCF and LCM in one place
The greatest common factor (GCF, also called greatest common divisor, GCD) of two whole numbers is the largest number that divides both exactly. The least common multiple (LCM) is the smallest positive number that both divide. The GCF simplifies fractions and ratios; the LCM finds common denominators and tells you when two repeating cycles line up again.
How they are calculated
Euclid’s algorithm finds the GCF quickly: replace the larger number by the remainder of the division of the two, and repeat until the remainder is 0. The last non-zero remainder is the GCF.
For 18 and 12: 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so GCF = 6.
The LCM follows from the GCF: LCM(a, b) = a × b ÷ GCF(a, b). For a third number, apply the same rules again: GCF(a, b, c) = GCF(GCF(a, b), c), and likewise for the LCM.
Worked example: 12, 18 and 30
- GCF(12, 18) = 6, then GCF(6, 30) = 6.
- LCM(12, 18) = 12 × 18 ÷ 6 = 36, then LCM(36, 30) = 36 × 30 ÷ 6 = 180.
- The fraction 12/18 simplifies to 2/3, dividing both by 6.
- Check: GCF × LCM of 12 and 18 = 6 × 36 = 216 = 12 × 18.
With prime factors
Another method writes each number as a product of primes: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. The GCF takes each common prime with its smallest exponent (2 × 3 = 6); the LCM takes every prime with its largest exponent (2² × 3² × 5 = 180).
GCF and LCM of 12 with other numbers
| Second number | GCF | LCM |
|---|---|---|
| 4 | 4 | 12 |
| 8 | 4 | 24 |
| 9 | 3 | 36 |
| 15 | 3 | 60 |
| 25 | 1 | 300 |
When the GCF is 1, the numbers are coprime, and their LCM is simply their product.
Where you use them
- Adding fractions: 1/12 + 1/18 uses the LCM 36 as common denominator: 3/36 + 2/36 = 5/36.
- Schedules: buses every 12 and 18 minutes leave together every 36 minutes.
- Cutting and tiling: the largest square tile that fits a 120 × 180 cm area without cuts is 60 cm, the GCF.
- Gears: two gears with 12 and 18 teeth return to the same position after 36 teeth have passed.