LCM and GCF: How to Find Them (With a Free Step-by-Step Calculator)
Updated December 2026 · 8 min read · Free, no sign-up
Quick answer: The GCF (greatest common factor) is the biggest number that divides all your numbers evenly. The LCM (least common multiple) is the smallest number that all your numbers divide into evenly. For 12 and 18, the GCF is 6 and the LCM is 36.
LCM and GCF Calculator
Type 2 to 10 whole numbers, separated by commas or spaces.
What are GCF and LCM?
GCF and LCM are two ways to look at how numbers relate to each other. One looks down at shared factors. The other looks up at shared multiples.
- Factors are numbers that divide another number exactly. The factors of 12 are 1, 2, 3, 4, 6 and 12.
- Multiples are what you get when you count by a number. The multiples of 12 are 12, 24, 36, 48 and so on.
The GCF is also called the GCD (greatest common divisor) or HCF (highest common factor). They all mean the same thing. Different countries and books use different names.
| GCF | LCM | |
|---|---|---|
| Full name | Greatest Common Factor | Least Common Multiple |
| Also called | GCD, HCF | Lowest common multiple |
| Looks at | Shared factors (down) | Shared multiples (up) |
| Size of answer | Never bigger than the smallest number | Never smaller than the biggest number |
| Main use | Simplify fractions, split into equal groups | Add fractions, find when events repeat together |
| Example (12, 18) | 6 | 36 |
How to find the GCF (3 methods)
Method 1: List the factors
Best for small numbers. Find the GCF of 24 and 36.
Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
Shared factors: 1, 2, 3, 4, 6, 12 → the biggest is GCF = 12
Method 2: Prime factorization
Break each number into prime factors. Multiply only the primes they share, using the smallest power of each.
18 = 2 × 3 × 3 = 2 × 3²
Shared: one 2 and one 3 → 2 × 3 = GCF = 6
Method 3: The Euclidean algorithm
Best for big numbers. Divide the larger number by the smaller one, then keep dividing the previous divisor by the remainder. The last non-zero remainder is the GCF.
12 = 2 × 6 + 0
The last non-zero remainder is 6 → GCF = 6
How to find the LCM (3 methods)
Method 1: List the multiples
Multiples of 6: 6, 12, 18, 24
The first one in both lists: LCM = 12
Method 2: Prime factorization
Multiply every prime that appears in any number, using the largest power of each.
Largest powers: 2² and 3² → 4 × 9 = LCM = 36
Method 3: Use the GCF
For two numbers: LCM = (a × b) ÷ GCF. For 12 and 18: (12 × 18) ÷ 6 = 216 ÷ 6 = 36.
Memory trick: GCF takes the fewest primes (only shared ones, smallest powers). LCM takes the most (all primes, biggest powers).
The GCF × LCM formula (only for two numbers)
For any two positive whole numbers a and b:
GCF(a, b) × LCM(a, b) = a × b
Check with 12 and 18: 6 × 36 = 216 and 12 × 18 = 216. ✓ This is a fast way to check your work.
Warning: this shortcut does not work for three or more numbers. For 4, 6 and 9 the GCF is 1 and the LCM is 36. But 1 × 36 = 36, while 4 × 6 × 9 = 216.
How to find the GCF and LCM of three or more numbers
Use prime factorization for all numbers at once, or work two at a time: GCF(a, b, c) = GCF(GCF(a, b), c) and LCM(a, b, c) = LCM(LCM(a, b), c).
15 = 3 × 5 · 18 = 2 × 3² · 24 = 2³ × 3
Only the prime 3 is in all three, smallest power 3¹ → GCF = 3
Biggest powers: 2³, 3², 5 → 8 × 9 × 5 = LCM = 360
Special cases worth knowing
- Two different primes (like 5 and 7): GCF = 1 and LCM = their product, 35.
- One number divides the other (like 4 and 12): GCF = 4 (the smaller) and LCM = 12 (the bigger).
- The number 1: GCF with 1 is always 1, and LCM with 1 is the other number.
- The GCF does not have to be prime. The GCF of 24 and 36 is 12, which is not prime.
- Numbers with GCF = 1 are called coprime (or relatively prime), such as 8 and 15.
GCF or LCM: which one do I need?
Read the question and look for what is happening. Words like “greatest” and “least” in the question can be misleading, so think about the situation.
| Use the GCF when you… | Use the LCM when you… |
|---|---|
| split things into equal groups | wait for things to happen together again |
| need the largest size that fits evenly | need the smallest amount that fits evenly |
| simplify a fraction | add or subtract unlike fractions |
| cut pieces with no waste | find the next time two schedules match |
GCF(24, 36) = 12 → 12 bags, each with 2 apples and 3 oranges.
LCM(12, 18) = 36 → after 36 minutes.
Using GCF and LCM with fractions
You need both skills whenever you work with fractions.
The LCM of the denominators is called the least common denominator (LCD).
Common mistakes to avoid
- Mixing them up. GCF is never bigger than your smallest number. LCM is never smaller than your biggest number. If your answer breaks this rule, check it.
- Using the wrong powers. GCF takes the smallest power of shared primes. LCM takes the biggest power of all primes.
- Stopping at the first common multiple you see. You need the smallest one.
- Using GCF × LCM = a × b for three numbers. It only works for two.
- Forgetting a prime. A missing prime in the factorization gives a wrong LCM. Multiply your factors back to check.
Practice problems (with answers)
| Numbers | GCF | LCM |
|---|---|---|
| 8, 12 | 4 | 24 |
| 9, 15 | 3 | 45 |
| 14, 35 | 7 | 70 |
| 7, 13 | 1 | 91 |
| 6, 8, 12 | 2 | 24 |
| 16, 24, 40 | 8 | 240 |
Try each one yourself first, then check it with the calculator above.
Frequently asked questions
What is the difference between LCM and GCF?
The GCF is the largest number that divides all the numbers evenly. The LCM is the smallest number that all the numbers divide into evenly. GCF looks at factors, and LCM looks at multiples.
Is GCF the same as GCD and HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
How do you find the LCM and GCF of two numbers?
Write each number as a product of primes. Multiply the shared primes (smallest powers) for the GCF. Multiply all the primes (largest powers) for the LCM. For 12 and 18, that gives 6 and 36.
What is the formula linking LCM and GCF?
For two numbers, GCF × LCM = a × b. So LCM = (a × b) ÷ GCF. It does not work for three or more numbers.
What are the LCM and GCF of two prime numbers?
The GCF is 1 and the LCM is the two primes multiplied together. For 5 and 7, the GCF is 1 and the LCM is 35.
Can the GCF be larger than one of the numbers?
No. The GCF can be equal to the smallest number but never larger than it. The LCM can be equal to the largest number but never smaller than it.
When do I use the LCM in fractions?
Use the LCM of the denominators to find a common denominator when you add or subtract fractions. Use the GCF to simplify the answer.
Need more tools? Try our free online scientific calculator for powers, roots, logs and trigonometry.