The greatest common factor (GCF) of two numbers is the largest number that divides both evenly; the least common multiple (LCM) is the smallest number both divide into. For 24 and 36, the GCF is 12 and the LCM is 72. The fastest way to get both for small numbers is prime factorization: the GCF uses the primes the numbers share, and the LCM uses every prime either one needs.
The GCF is also called the greatest common divisor (GCD) or highest common factor (HCF). They are the same thing.
Method 1: List factors and multiples
For small numbers, listing works and makes the definitions concrete.
GCF of 24 and 36:
- Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
- Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
- The largest number on both lists is 12.
LCM of 24 and 36:
- Multiples of 36: 36, 72, 108, …
- Check each against 24: 36 ÷ 24 is not whole; 72 ÷ 24 = 3. The LCM is 72.
Listing multiples of the larger number is quicker than listing both. The common factors calculator produces full factor lists for any set of numbers.
Method 2: Prime factorization
Break each number into primes, then:
- GCF: multiply the primes the numbers have in common, using the lowest power of each.
- LCM: multiply every prime that appears in either number, using the highest power of each.
24 = 2³ × 3
36 = 2² × 3²
GCF = 2² × 3 = 12 (lowest powers of the shared primes)
LCM = 2³ × 3² = 72 (highest powers of all primes)
This method scales well to three or more numbers. For 12, 18 and 30:
| Number | Prime factors |
|---|---|
| 12 | 2² × 3 |
| 18 | 2 × 3² |
| 30 | 2 × 3 × 5 |
| GCF | 2 × 3 = 6 |
| LCM | 2² × 3² × 5 = 180 |
The prime factorization calculator builds the factor trees if the numbers are large.
Method 3: The ladder (cake) method
Write the numbers side by side and divide by any prime that goes into all of them. Repeat until no common prime remains.
2 | 24 36
2 | 12 18
3 | 6 9
2 3
GCF = numbers down the left side = 2 × 2 × 3 = 12
LCM = left side × bottom row = 2 × 2 × 3 × 2 × 3 = 72
Many students find this the most visual method because it produces both answers from one diagram.
Method 4: Euclid’s algorithm
For large numbers, factoring is slow. Euclid’s algorithm, described more than 2,000 years ago, finds the GCF using only division:
- Divide the larger number by the smaller one and note the remainder.
- Replace the larger number with the smaller one, and the smaller with the remainder.
- Repeat until the remainder is 0. The last nonzero remainder is the GCF.
GCF(1071, 462)
1071 = 2 × 462 + 147
462 = 3 × 147 + 21
147 = 7 × 21 + 0 → GCF = 21
Three short divisions replace factoring two four-digit numbers. Computers use this algorithm for exactly that reason. The Euclid’s algorithm calculator shows every step.
The GCF × LCM shortcut
For two positive whole numbers:
So once you have the GCF from Euclid’s algorithm, the LCM follows immediately:
LCM(1071, 462) = 1071 × 462 ÷ 21 = 23,562
Check with 24 and 36: 12 × 72 = 864 = 24 × 36 ✓
This identity holds only for two numbers. For three or more, apply it in pairs: LCM(a, b, c) = LCM(LCM(a, b), c).
Which one does a word problem need?
The hardest part of GCF and LCM problems is usually deciding which to use.
| Clue in the problem | You need | Why |
|---|---|---|
| Split into the largest equal groups, with nothing left over | GCF | You are dividing the quantities |
| Biggest square tile, longest equal pieces | GCF | Same size must divide every length |
| When will events next happen together? | LCM | You are counting up in multiples |
| Smallest quantity you can buy in packs of each size | LCM | The total must be a multiple of each pack |
A GCF problem: A teacher has 48 pencils and 60 erasers and wants to make identical supply kits with nothing left over. The largest number of kits is GCF(48, 60) = 12, each holding 4 pencils and 5 erasers.
Another GCF problem: The largest square tile that exactly covers a 270 cm × 360 cm floor without cutting has a side of GCF(270, 360) = 90 cm, giving a 3 × 4 grid.
An LCM problem: One bus leaves the station every 12 minutes and another every 18 minutes. If both leave at 8:00, they next leave together after LCM(12, 18) = 36 minutes, at 8:36.
Another LCM problem: Hot dogs come in packs of 10 and buns in packs of 8. The smallest number of each you can buy to match exactly is LCM(10, 8) = 40: four packs of hot dogs and five packs of buns.
Common mistakes
- Mixing up lowest and highest powers. In the prime factorization method, the GCF takes the lowest power of each shared prime and the LCM takes the highest power of every prime. Swapping them gives 2³ × 3² = 72 as a “GCF” for 24 and 36, which is larger than both numbers and therefore impossible.
- Leaving out primes that appear in only one number. The LCM of 12 and 30 needs the 5 from 30, even though 12 has no 5. LCM(12, 30) = 2² × 3 × 5 = 60.
- Assuming the product is the LCM. 24 × 36 = 864 is a common multiple, but not the least one unless the numbers share no factors.
- A quick sanity check: the GCF can never be larger than the smallest number, and the LCM can never be smaller than the largest.
Where GCF and LCM show up
- Simplifying fractions divides by the GCF. See how to simplify fractions.
- Adding fractions uses the LCM of the denominators, called the least common denominator. See how to add fractions with unlike denominators, or use the LCD calculator.
- Ratios and aspect ratios are reduced by the GCF, as in 1920:1080 = 16:9.
- Gears and schedules repeat on an LCM cycle.
For quick answers, the GCF calculator and the LCM calculator accept any list of whole numbers and show the method.
Frequently asked questions
What is the difference between GCF and LCM?
The greatest common factor (GCF) is the largest number that divides into each of your numbers. The least common multiple (LCM) is the smallest number that each of your numbers divides into. For 24 and 36, the GCF is 12 and the LCM is 72.
How are the GCF and LCM related?
For any two positive whole numbers, GCF × LCM equals the product of the numbers. So once you know one, you can find the other: LCM(24, 36) = 24 × 36 ÷ 12 = 72. This shortcut does not work for three or more numbers.
What is the GCF of two prime numbers?
It is 1, because a prime's only factors are 1 and itself. Numbers whose GCF is 1 are called relatively prime or coprime, and their LCM is simply their product: the LCM of 7 and 11 is 77.
Can the GCF be one of the numbers itself?
Yes. If one number divides the other evenly, the smaller one is the GCF and the larger one is the LCM. For 6 and 18, the GCF is 6 and the LCM is 18.
Is the LCM the same as the least common denominator?
Yes, applied to denominators. The least common denominator of 5/12 and 7/18 is the LCM of 12 and 18, which is 36.