LCM and GCF of a list of numbers
Enter two or more positive whole numbers. The prime factorization shows step by step.
- 12 =2² × 3
- 18 =2 × 3²
- 30 =2 × 3 × 5
- GCF: shared primes, lowest powers2 × 3
- LCM: every prime, highest powers2² × 3² × 5
- GCF6
- LCM180
How to find the LCM and GCF
The safest method is to break each number into prime factors. The GCF uses only the primes that appear in every number, each with its lowest power. The LCM uses every prime that appears in any number, each with its highest power.
LCM and GCF are the engine behind adding fractions (common denominator) and simplifying them. See the fraction calculator, which uses both.
Worked examples
| Numbers | Prime factors | GCF | LCM |
|---|---|---|---|
| 12 and 18 | 2² × 3 and 2 × 3² | 6 | 36 |
| 12, 18, and 30 | 2² × 3, 2 × 3², 2 × 3 × 5 | 6 | 180 |
| 8 and 15 | 2³ and 3 × 5 | 1 | 120 |
| 24 and 36 | 2³ × 3 and 2² × 3² | 12 | 72 |
| 7 and 14 | 7 and 2 × 7 | 7 | 14 |
For 8 and 15, no prime repeats, so the GCF is 1 (the numbers are called relatively prime or coprime) and the LCM is the plain product, 8 × 15 = 120.
When to use the LCM and GCF
- LCM: when events repeat on cycles. Buses that leave every 12 and 18 minutes depart together every 36 minutes.
- LCM: a common denominator for adding or subtracting fractions.
- GCF: splitting into equal groups with nothing left over. With 12 sophomores and 18 juniors, the most equal teams you can make is 6.
- GCF: simplifying fractions. 18/24 divides by 6 and becomes 3/4.
To compare quantities, use the proportion calculator. For general math, the scientific calculator covers the rest.
Frequently asked questions
How do you find the LCM of two numbers?
Break both numbers into primes and multiply every prime with its highest power. For 12 (2² × 3) and 18 (2 × 3²), the LCM is 2² × 3² = 36.
How do you find the GCF of two numbers?
Break both numbers into primes and multiply only the shared primes, each with its lowest power. For 12 and 18, the GCF is 2 × 3 = 6. The Euclidean algorithm, which uses repeated division, gets the same answer.
What is the difference between LCM and GCF?
The LCM is the smallest common multiple and is always at least as big as the largest number. The GCF is the largest common factor and is never bigger than the smallest number. For 12 and 18, they are 36 and 6.
Is GCF the same as GCD?
Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the same number. Some textbooks also say HCF, for highest common factor.
How do you find the LCM and GCF of three or more numbers?
The method stays the same: factor every number. The GCF uses the primes present in all of them, and the LCM uses all primes. For 12, 18, and 30, the GCF is 6 and the LCM is 180.
When is the GCF equal to 1?
The GCF is 1 when the numbers share no prime, which makes them relatively prime. That is the case for 8 and 15, and then the LCM is the product of the numbers: 120.
Sources and method
- Elementary number theory: prime factorization, LCM, and GCF