GCF and LCM Calculator

🔗 GCF & LCM
Live result

Whole numbers from 1 to 1,000,000,000,000, separated by commas or spaces.

Examples:
Greatest common factor 2 numbers
GCF 6
LCM 36
GCF6
LCM36
Coprime?No
GCF × LCM216
Prime factor table
Rule: GCF uses the lowest power of shared primes; LCM uses the highest power of every prime.
Step-by-Step:

The GCF is the biggest number that divides into all your numbers; the LCM is the smallest number they all divide into. Enter 2 to 6 whole numbers to get both, worked out by prime factorization, by listing factors and multiples, or with Euclid's algorithm.

Factors Go Down, Multiples Go Up

The GCF comes from the numbers' factors, so it's never bigger than the smallest number. The LCM comes from their multiples, so it's never smaller than the largest.

GCF: Greatest Common Factor

Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18. The biggest one they share is 6. Also called the GCD (greatest common divisor) or HCF (highest common factor).

GCF(12, 18)=6

LCM: Least Common Multiple

Multiples of 12: 12, 24, 36, 48… Multiples of 18: 18, 36, 54… The first one they share is 36. In fractions it's called the lowest common denominator.

LCM(12, 18)=36

Three Ways to Find the GCF

All three give the same answer. Pick the one that suits the size of the numbers; the calculator above shows each.

Listing

Write out every factor of each number and pick the largest shared one. Best for small numbers.

8: 1 2 4 8 · 12: 1 2 3 4 6 12→4

Prime Factors

Break each number into primes. Shared primes at their lowest power give the GCF; every prime at its highest power gives the LCM.

48 = 2⁴ × 3, 180 = 2² × 3² × 5→12

Euclid's Algorithm

Divide, keep the remainder, repeat. The last non-zero remainder is the GCF. Fastest for big numbers.

252 → 105 → 42 → 21 → 0→21
The two-number shortcut For any two numbers, GCF × LCM = the numbers multiplied together. So once you know the GCF, LCM = a × b ÷ GCF: 12 × 18 ÷ 6 = 36. (This doesn't work for three or more numbers at once.)

GCF or LCM: Which Do I Need?

Splitting things into equal groups is a GCF problem. Waiting for things to line up again is an LCM problem.

ProblemUseAnswer
24 roses and 36 tulips into identical bouquets, using every flower. Most bouquets?GCF12 bouquets
Cut 48 cm and 180 cm ribbons into equal pieces, as long as possibleGCF12 cm pieces
Simplify the fraction 18/24GCF÷ 6 → 3/4
Hot dogs come in 10s, buns in 8s. Fewest of each to match?LCM40 of each
Buses leave every 12 and 18 minutes. When do they next leave together?LCMin 36 minutes
Add 1/12 + 1/18 (common denominator)LCM3/36 + 2/36 = 5/36

GCF and LCM on a 4 Function Calculator

A basic calculator has no GCF key, but division tells you whether one number is a factor of another: a whole-number answer means yes.

Is 6 a Factor of 18?

18÷6=
3whole, so yes

LCM from the GCF

12×18÷6=
36

Euclid's Remainder

252÷105=2.4, then252−210=
42
Learn more

See every method with worked examples in GCF vs LCM: How to Find Them and When to Use Each.

Frequently Asked Questions

What is the difference between GCF and LCM?

The GCF is the largest number that divides into all of the numbers; the LCM is the smallest number they all divide into. For 12 and 18, the GCF is 6 and the LCM is 36. The GCF is never bigger than the smallest number, and the LCM is never smaller than the largest.

How do you find the GCF using prime factorization?

Multiply the primes every number shares, using the lowest power of each. 12 = 2² × 3 and 18 = 2 × 3², so the GCF is 2 × 3 = 6.

How do you find the LCM using prime factorization?

Multiply every prime that appears, using the highest power of each. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.

What is Euclid's algorithm?

A fast way to find the GCF by repeated division. Divide the larger number by the smaller, then divide the previous divisor by the remainder, until the remainder is 0. The last non-zero remainder is the GCF: 252 = 2 × 105 + 42, 105 = 2 × 42 + 21, 42 = 2 × 21 + 0, so the GCF is 21.

Is there a quick way to get the LCM from the GCF?

Yes, for two numbers: LCM = a × b ÷ GCF. For 12 and 18, 12 × 18 ÷ 6 = 36. It works because GCF × LCM always equals the product of the two numbers.

What does it mean if the GCF is 1?

The numbers are relatively prime (coprime): they share no factor except 1. Their LCM is just their product. 15 and 28 have a GCF of 1 and an LCM of 15 × 28 = 420, even though neither number is prime.