Factors & primes
How to Find the GCF and LCM
To find the GCF, take the largest number that divides all of your numbers exactly; to find the LCM, take the smallest number they all divide into. For 18 and 24 that is a GCF of 6 and an LCM of 72. This guide covers four methods, listing, prime factorization, the ladder and Euclid’s algorithm, plus how to tell which one a word problem wants.
How to find the GCF and LCM
The greatest common factor (GCF) is the biggest number that goes into every number in your set. The least common multiple (LCM) is the smallest number that every number in your set goes into. One looks downward, at what the numbers are built from. The other looks upward, at what the numbers build.
The quickest reliable recipe for both:
- Write each number as a product of primes.
- For the GCF, multiply the primes every number shares, using the lowest power of each.
- For the LCM, multiply every prime that appears anywhere, using the highest power of each.
The rest of this guide shows that recipe and three others in full, so you can pick the one that suits the numbers in front of you. If you only need an answer, the GCF calculator and the LCM calculator show every step of their working.
Method 1: list the factors and the multiples
Listing is the method most people learn first, and for small numbers it is the fastest.
How to find the GCF by listing
Write every factor of each number, then circle the ones that appear in all the lists. The largest circled number is the GCF.
To make sure no factor is missed, find them in pairs: 1 × 18, 2 × 9, 3 × 6. You can stop once the pairs meet in the middle. The factor calculator lists all factors and pairs for any number if you want to check a list.
How to find the LCM by listing
Write the first several multiples of each number and stop at the first value that appears in every list.
Start the listing with the larger number. Its multiples are farther apart, so you reach the answer in fewer steps; then just check each one against the smaller number. 24 fails, 48 fails, 72 works because 72 ÷ 18 = 4. Those multiples are the rows of a multiplication chart, which is handy for numbers up to 12.
Listing breaks down as numbers grow. The LCM of 56 and 84 is 168, three multiples of 56 in. The LCM of 45 and 75 is 225, five multiples of 45 in. For larger or awkward numbers, use primes.
Method 2: prime factorization
Break each number into primes. A factor tree or a division ladder both work, and the prime factorization calculator draws either. Then compare the two lists prime by prime.
Example: GCF and LCM of 60 and 90
A Venn diagram makes the same idea visual. Write each number’s primes in its own circle, putting shared primes in the overlap. For 60 and 90, the overlap holds 2, 3 and 5. Left over, 60 has one extra 2 and 90 has one extra 3.
Why does this work? The GCF must divide every number, so it can only use primes they all contain, no more times than the number with the fewest copies. The LCM must contain every number, so it needs each prime as many times as the number with the most copies. Anything less fails to be divisible by that number; anything more is not the least. If you need a refresher on primes themselves, start with what a prime number is, and for the notation, exponent rules.
Method 3: the ladder (cake) method
The ladder, also called the cake or box method, finds both answers in a single diagram. Write the numbers side by side. Divide them by any prime that goes into all of them, and write the quotients underneath. Keep going until no prime divides every number in the bottom row.
Example: GCF and LCM of 48 and 72
The left column is everything the two numbers had in common, which is the GCF by definition. The bottom row is what is left of each number once the shared part is removed. Multiply the shared part by both leftovers and you rebuild the smallest number that contains both originals, which is the LCM. You can divide by any common prime in any order, or even by a common composite such as 12, and the answer comes out the same.
The ladder with three numbers
With three or more numbers the two answers need slightly different rules. For the GCF, stop as soon as no prime divides all the numbers. For the LCM, keep going while a prime divides at least two of them, carrying down any number it does not divide unchanged.
Method 4: Euclid’s algorithm for large numbers
When the numbers are large, factoring them is slow. Euclid’s algorithm finds the GCF with nothing but division. Divide the larger number by the smaller and note the remainder. Then divide the old divisor by the remainder. Repeat until the remainder is 0. The last non-zero remainder is the GCF.
Example: GCF and LCM of 252 and 198
It works because any number dividing both 252 and 198 must also divide their difference, and so must divide the remainder 54. Each step swaps the pair for a smaller pair with exactly the same common factors, until one of them divides the other. A remainder calculator is useful for checking each line.
The LCM line uses the two-number identity:
Do not use it on three numbers at once. For 20, 30 and 45, 20 × 30 × 45 ÷ 5 = 5,400, far from the true LCM of 180.
Which method to use
| Method | Best for | Gives |
|---|---|---|
| Listing | Small numbers, up to about 50 | GCF or LCM, one at a time |
| Prime factorization | Any size you can factor; three or more numbers | Both, and shows why |
| Ladder | Two or three numbers with obvious common primes | Both from one diagram |
| Euclid’s algorithm | Large numbers, or numbers that are hard to factor | GCF directly; LCM by the formula |
Whichever you use, a quick check catches most errors. Divide each original number by your GCF: the results should share no common factor. Divide your LCM by each original number: every result should be a whole number.
GCF or LCM? Reading word problems
The hardest part of most word problems is deciding which one is being asked for. The question’s direction gives it away.
- GCF problems split things down into the largest possible equal groups. Look for “largest”, “greatest”, “most groups”, “biggest tile”, “longest piece”.
- LCM problems build things up until they line up. Look for “smallest”, “least”, “next time”, “at the same time”, “again together”.
Example: a GCF problem
A florist has 36 red roses and 48 white roses and wants identical bouquets using every flower. What is the greatest number of bouquets?
Example: an LCM problem
Two runners start a lap together. One finishes a lap every 6 minutes, the other every 8 minutes. When are they next at the start together?
In fraction arithmetic the two show up side by side. The LCM of the denominators is the least common denominator for adding, which the least common denominator calculator works out, and dividing by the GCF of top and bottom is how you reduce, as covered in how to simplify fractions.
GCF and LCM of common pairs
The last column confirms the two-number identity for each row.
| Numbers | GCF | LCM | GCF × LCM |
|---|---|---|---|
| 6 and 8 | 2 | 24 | 48 = 6 × 8 |
| 9 and 12 | 3 | 36 | 108 = 9 × 12 |
| 10 and 25 | 5 | 50 | 250 = 10 × 25 |
| 14 and 35 | 7 | 70 | 490 = 14 × 35 |
| 16 and 40 | 8 | 80 | 640 = 16 × 40 |
| 18 and 24 | 6 | 72 | 432 = 18 × 24 |
| 24 and 30 | 6 | 120 | 720 = 24 × 30 |
| 27 and 36 | 9 | 108 | 972 = 27 × 36 |
| 30 and 45 | 15 | 90 | 1350 = 30 × 45 |
| 32 and 48 | 16 | 96 | 1536 = 32 × 48 |
| 40 and 60 | 20 | 120 | 2400 = 40 × 60 |
| 45 and 75 | 15 | 225 | 3375 = 45 × 75 |
| 48 and 72 | 24 | 144 | 3456 = 48 × 72 |
| 56 and 84 | 28 | 168 | 4704 = 56 × 84 |
| 60 and 90 | 30 | 180 | 5400 = 60 × 90 |
Special cases
- One number divides the other. The smaller is the GCF and the larger is the LCM. For 7 and 21: GCF 7, LCM 21.
- The numbers share no prime. The GCF is 1 and the LCM is the product. For 8 and 9: GCF 1, LCM 72. This happens even when neither number is prime, a point covered in prime and composite numbers.
- Two different primes. Always GCF 1 and LCM equal to their product: 5 and 7 give 1 and 35.
- The same number twice. GCF and LCM are both that number. They are equal only in this case.
Common mistakes
- Swapping the power rules. Lowest powers for the GCF, highest for the LCM. A useful memory hook: the GCF is the smaller answer and uses the smaller powers.
- Including unshared primes in the GCF. A prime that appears in only one number can never be part of a common factor.
- Leaving unshared primes out of the LCM. The LCM has to be divisible by every number, so it needs every prime.
- Assuming the LCM is the product. Only true when the GCF is 1. The product of 18 and 24 is 432, but their LCM is 72.
- Stopping the ladder too soon. If the bottom numbers still share a prime, divide again. Stopping at 4 and 6 instead of 2 and 3 gives a GCF that is too small.
- Using the a × b ÷ GCF formula on three numbers. Apply it pairwise or use prime powers.
Frequently asked questions
How do you find the GCF of 18 and 24?
The GCF of 18 and 24 is 6. List the factors: 18 has 1, 2, 3, 6, 9, 18 and 24 has 1, 2, 3, 4, 6, 8, 12, 24. The largest number in both lists is 6. With primes, 18 = 2 × 3² and 24 = 2³ × 3 share one 2 and one 3, and 2 × 3 = 6.
How do you find the LCM of 9 and 12?
The LCM of 9 and 12 is 36. Multiples of 12 are 12, 24, 36, and 36 is the first one 9 divides. With primes, 9 = 3² and 12 = 2² × 3; the highest powers give 2² × 3² = 36. By formula, 9 × 12 ÷ 3 = 108 ÷ 3 = 36, since the GCF is 3.
What are the GCF and LCM of 60 and 90?
The GCF is 30 and the LCM is 180. In primes, 60 = 2² × 3 × 5 and 90 = 2 × 3² × 5. The lowest powers multiply to 2 × 3 × 5 = 30 and the highest to 2² × 3² × 5 = 180. As a check, 30 × 180 = 5,400, which equals 60 × 90.
What is the ladder method for GCF and LCM?
The ladder method divides the numbers side by side by primes they all share, writing each prime on the left and the quotients underneath, until the bottom numbers share nothing. The GCF is the product of the primes on the left. The LCM is that product times every number left in the bottom row. For 48 and 72 that gives a GCF of 24 and an LCM of 144.
How do I know whether to use the GCF or the LCM?
Ask whether the problem splits things into equal groups or waits for things to line up. Splitting a quantity into the largest equal groups, tiles or pieces is a GCF problem. Finding the smallest shared amount, or when two repeating events next happen together, is an LCM problem. The GCF answer is never bigger than your numbers; the LCM answer is never smaller.
Can the GCF and LCM be the same?
Only when all the numbers are equal. The GCF is at most the smallest number and the LCM is at least the largest, so they can only meet when smallest and largest are the same. The GCF and LCM of 5 and 5 are both 5. For any two different numbers, the LCM is strictly larger than the GCF.
How do you find the GCF and LCM of three numbers?
Use prime factorization: the GCF takes primes shared by all three at their lowest power, and the LCM takes every prime at its highest power. For 20, 30 and 45, that gives a GCF of 5 and an LCM of 180. You can also work pairwise: find the answer for the first two numbers, then combine that result with the third.
Calculators for this
Every one of these shows the working, so you can check the method as well as the answer.
More guides
https://fourfunctioncalculator.com/how-to-find-gcf-and-lcm/