LCM and GCF
LCM and GCF: How to Find Them + Free Step-by-Step Calculator

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.

GCFLCM
Full nameGreatest Common FactorLeast Common Multiple
Also calledGCD, HCFLowest common multiple
Looks atShared factors (down)Shared multiples (up)
Size of answerNever bigger than the smallest numberNever smaller than the biggest number
Main useSimplify fractions, split into equal groupsAdd fractions, find when events repeat together
Example (12, 18)636

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 24: 1, 2, 3, 4, 6, 8, 12, 24
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.

12 = 2 × 2 × 3 = 2² × 3
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.

18 = 1 × 12 + 6
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 4: 4, 8, 12, 16, 20
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.

12 = 2² × 3 and 18 = 2 × 3²
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).

Find the GCF and LCM of 15, 18 and 24.
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 groupswait for things to happen together again
need the largest size that fits evenlyneed the smallest amount that fits evenly
simplify a fractionadd or subtract unlike fractions
cut pieces with no wastefind the next time two schedules match
Problem 1 (GCF): You have 24 apples and 36 oranges. You want identical bags with no fruit left over. What is the most bags you can make?
GCF(24, 36) = 12 → 12 bags, each with 2 apples and 3 oranges.
Problem 2 (LCM): One bus leaves every 12 minutes and another every 18 minutes. They leave together now. When do they leave together again?
LCM(12, 18) = 36 → after 36 minutes.

Using GCF and LCM with fractions

You need both skills whenever you work with fractions.

Simplify 18/24 (use the GCF): GCF(18, 24) = 6. Divide top and bottom by 6 → 3/4
Add 1/4 + 1/6 (use the LCM): LCM(4, 6) = 12. Then 1/4 = 3/12 and 1/6 = 2/12 → 3/12 + 2/12 = 5/12

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)

NumbersGCFLCM
8, 12424
9, 15345
14, 35770
7, 13191
6, 8, 12224
16, 24, 408240

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.

Scroll to Top