LCM vs GCF: The Difference, the Check, and When to Use Each
The LCM builds outward to the smallest shared multiple, the GCF carves inward to the largest shared factor, and LCM times GCF equals a times b. The definitions, the factorization picture, the decision rule, and worked problems using both.
The LCM and the GCF are mirror images, and most confusion between them is a confusion of direction. This guide defines both precisely, shows the prime-factorization picture that produces both at once, gives a one-question decision rule, and works problems that use each concept in its own step.
- LCM is the smallest number the inputs all divide into, larger than the inputs. GCF is the largest number dividing all the inputs, smaller than the inputs.
- For 12 and 18, LCM is 36 and GCF is 6, and 36 times 6 equals 216, which is 12 times 18.
- Prime factorization: the LCM takes the highest prime powers, the GCF takes the lowest powers of the shared primes.
- Decision rule: if the answer should be bigger, use the LCM. If it should be smaller, use the GCF.
- Mirror images: smallest multiple, largest factor
- Definitions that do not overlap
- When to use which: the decision rule
- Three or more numbers: both concepts at once
- Special cases where the two meet, or part ways
- Euclid’s algorithm, and why the GCF is computed first
- Worked problems, both concepts in the same room
- Checking, and the common errors
Mirror images: smallest multiple, largest factor
The LCM and the GCF are mirror images, and most confusion between them comes from forgetting which side of the mirror each one lives on. The least common multiple is the smallest number that your inputs all divide into: it is bigger than the inputs, it is a multiple of each of them, and it answers questions about alignment, repetition, and common denominators. The greatest common factor, also called the greatest common divisor, is the largest number that divides all of your inputs: it is smaller than the inputs, it is a factor of each of them, and it answers questions about splitting, simplifying, and sharing. For 12 and 18, the LCM is 36, larger than both, and the GCF is 6, smaller than both, and the two numbers together contain the whole story of how 12 and 18 relate. This guide states the difference precisely, shows how each is computed, works through the cases where they coincide and where they do not, and gives a decision rule for every problem that arrives disguised as the other.
The calculator on this site computes both at once, which is the right design, because the two numbers check each other: for any pair of positive whole numbers, LCM × GCF = a × b. For 12 and 18, 36 × 6 = 216 = 12 × 18. For 25 and 30, 150 × 5 = 750 = 25 × 30. For 7 and 5, 35 × 1 = 35 = 7 × 5. If you know one, the product identity gives you the other, and if you compute both independently and the identity fails, one of them is wrong. Keep that identity in mind throughout this guide, because it is the thread that ties the two concepts together, and the check that catches every confusion between them.
Definitions that do not overlap
Precision first, because loose language is the source of the confusion. A multiple of a number is the number times any whole number: multiples of 12 are 12, 24, 36, 48, and multiples of 18 are 18, 36, 54, 72. A common multiple is a number appearing in both lists, and the least common multiple is the smallest such number, 36. A factor of a number is a whole number that divides it evenly: factors of 12 are 1, 2, 3, 4, 6, and 12, and factors of 18 are 1, 2, 3, 6, 9, and 18. A common factor appears in both lists, and the greatest common factor is the largest such number, 6. The two definitions move in opposite directions, one outward to larger numbers, one inward to smaller ones, and the words least and greatest are the signposts: the LCM is the least of the large numbers, the GCF is the greatest of the small ones. Swap the adjectives and the definitions collapse, which is exactly the error to avoid.
Prime factorization makes the mirror image literal. Write 12 = 2² × 3 and 18 = 2 × 3². The LCM takes the highest power of every prime, 2² × 3² = 36, and the GCF takes the lowest power of every shared prime, 2 × 3 = 6. The highest powers build outward, the lowest powers carve inward, and the two results multiply to the product of the inputs, because every prime power in either input is counted exactly once across the two results, at its high power in one and its low power in the other. For 20 and 30: 20 = 2² × 5 and 30 = 2 × 3 × 5, so the LCM takes 2² × 3 × 5 = 60 and the GCF takes 2 × 5 = 10, and 60 × 10 = 600 = 20 × 30. For 8 and 12: 8 = 2³ and 12 = 2² × 3, so the LCM is 2³ × 3 = 24 and the GCF is 2² = 4, and 24 × 4 = 96 = 8 × 12. Learn the factorization picture and the two concepts stop competing, because they are the same picture read in two directions.
| Pair | Prime factorizations | LCM (highest powers) | GCF (lowest powers) | Check: LCM × GCF |
|---|---|---|---|---|
| 12, 18 | 2² × 3 and 2 × 3² | 36 | 6 | 216 = 12 × 18 |
| 20, 30 | 2² × 5 and 2 × 3 × 5 | 60 | 10 | 600 = 20 × 30 |
| 8, 12 | 2³ and 2² × 3 | 24 | 4 | 96 = 8 × 12 |
| 25, 30 | 5² and 2 × 3 × 5 | 150 | 5 | 750 = 25 × 30 |
| 15, 25 | 3 × 5 and 5² | 75 | 5 | 375 = 15 × 25 |
| 7, 5 | 7 and 5 | 35 | 1 | 35 = 7 × 5 |
| 7, 14 | 7 and 2 × 7 | 14 | 7 | 98 = 7 × 14 |
| 6, 10 | 2 × 3 and 2 × 5 | 30 | 2 | 60 = 6 × 10 |
When to use which: the decision rule
Ask one question: is the answer supposed to be bigger than the inputs, or smaller? If the problem asks when two repeating things next coincide, what denominator two fractions share, or how many items fit a repeating pattern, the answer is bigger, and it is the LCM. Two buses every 12 and 18 minutes meet every 36 minutes. Fractions with denominators 4 and 6 share the denominator 12. Gears with 12 and 18 teeth realign after 36 teeth. If the problem asks how large the equal pieces can be, how far a fraction can be reduced, or what the largest shared measure is, the answer is smaller, and it is the GCF. A 12 by 18 rectangle tiles with the largest square tiles of side 6. The fraction 12/18 reduces by dividing top and bottom by 6, giving 2/3. A group of 12 and a group of 18 split into the largest equal subgroups of 6. Bigger means LCM, smaller means GCF, and that single question resolves nearly every problem that arrives without a label.
The wording of textbook problems usually gives the direction away, if it is read carefully. Words like together, again, at the same time, both, every, and common denominator point to the LCM, because they describe cycles meeting. Words like largest, greatest, equally, simplify, reduce, and in equal groups point to the GCF, because they describe dividing down. The trap problems are the ones that mention both, such as a question that asks for the smallest tile that covers a floor and the largest tile that divides it, or a question that uses the word common for both concepts, as in common multiple and common factor, where common means shared in both cases and only least and greatest distinguish them. When a problem is genuinely ambiguous, compute both, state both, and let the product identity confirm them. Computing both takes little longer than computing one, and it removes the ambiguity entirely.
Three or more numbers: both concepts at once
With three or more inputs, the LCM and the GCF are computed by the same folding idea, but the folding is not symmetric in the way beginners expect. The LCM of three numbers folds pairwise: LCM(9, 12, 15) = LCM(LCM(9, 12), 15) = LCM(36, 15) = 180, and the GCF of three numbers is the largest number dividing all three: GCF(9, 12, 15) = 3, since 3 divides all three and no larger number does. Note that the pairwise product identity, LCM × GCF = a × b, holds only for pairs. For three numbers, LCM(9, 12, 15) × GCF(9, 12, 15) = 180 × 3 = 540, which is not 9 × 12 × 15 = 1,620, and no simple identity replaces it. The check for three numbers is direct: the LCM must be divisible by every input, and the GCF must divide every input, and each must be extreme, the smallest such multiple and the largest such factor. Test both claims by trying the next candidate down or up: 90 is divisible by 9 and 15 but not by 12, so it is not a common multiple at all, and 6 divides 12 but not 9 or 15, so it is not a common factor.
Worked triples make the asymmetry concrete. For 4, 6, and 8, the LCM is 24 and the GCF is 2: 24 is divisible by 4, 6, and 8, and 2 divides all three, while 3 divides 6 but not 4 or 8. For 2, 3, and 5, the LCM is 30, their product, since they are pairwise coprime, and the GCF is 1, since no number larger than 1 divides all three. For 4, 8, and 9, the LCM is 72 and the GCF is 1: 72 is divisible by all three, and the only common factor is 1, because 9 shares nothing with 4 or 8. For 3, 6, and 9, the LCM is 18 and the GCF is 3, the tidiest triple of all, since every input is a multiple of 3 and 18 is the smallest number divisible by all three. The calculator on this site reports the GCF of the full set alongside the LCM, and reading both together, rather than either alone, is how the relationship between a set of numbers is actually understood.
Special cases where the two meet, or part ways
Three special cases are worth memorising, because they recur in examinations and in searches. First, coprime numbers: when the inputs share no factor except 1, the GCF is 1 and the LCM is the product. LCM(3, 7) = 21 with GCF 1, LCM(11, 6) = 66 with GCF 1, LCM(8, 9) = 72 with GCF 1, and LCM(10, 11) = 110 with GCF 1. Second, divisibility: when one number divides the other, the LCM is the larger number and the GCF is the smaller. LCM(7, 14) = 14 with GCF 7, LCM(3, 15) = 15 with GCF 3, LCM(5, 10) = 10 with GCF 5, and LCM(12, 4) = 12 with GCF 4. Third, equal numbers: when the inputs are identical, the LCM and the GCF are both that number, LCM(9, 9) = 9 and GCF(9, 9) = 9, the one case where the mirror images coincide. Recognising these cases before computing saves the computation, and more importantly, it gives an instant check on any computed answer: if the inputs are coprime and the LCM is not their product, the LCM is wrong.
The least common factor deserves a paragraph of its own, because it appears in searches and it is a trap. The least common factor of two numbers is always 1, since 1 divides everything, which makes the phrase useless as a concept and a reliable sign that the searcher meant something else, usually the LCM, the GCF, or the least common multiple misremembered. This guide states that plainly rather than building a section around a non-concept, and the calculator treats such inputs as LCM problems, which is what they are. Similarly, the least common divisor is sometimes used as a synonym for the LCM in older textbooks, and sometimes confused with the GCF: the safe response is to compute both, state both, and let the question’s direction, bigger or smaller, decide which one was wanted.
Euclid’s algorithm, and why the GCF is computed first
Euclid’s algorithm deserves a section of its own, because it is the engine underneath the GCD method, and it is older than every other method in this subject by two thousand years. To find the GCF of two numbers, divide the larger by the smaller and keep the remainder, then divide the previous divisor by the remainder, and repeat until the remainder is zero. The last nonzero remainder is the GCF. For 18 and 12: 18 ÷ 12 leaves 6, 12 ÷ 6 leaves 0, so the GCF is 6. For 30 and 25: 30 ÷ 25 leaves 5, 25 ÷ 5 leaves 0, so the GCF is 5. For 25 and 15: 25 ÷ 15 leaves 10, 15 ÷ 10 leaves 5, 10 ÷ 5 leaves 0, so the GCF is 5. The algorithm needs no factorization, no prime lists, and no guessing, and it finishes in a handful of steps even for numbers in the thousands, which is why it survives in every computer implementation of the LCM, including the one on this site, where the GCD-method steps display shows it working.
Once the GCF is known, the LCM follows from the product identity in one division, and that is the practical relationship between the two concepts for computation: the GCF is the hard part, the LCM is the division. Prime factorization gives both at once from the same factorizations, the ladder gives the LCM directly with the GCF recoverable from the identity, and listing gives the LCM directly with no GCF at all. A worker who can find a GCF by Euclid and convert it to an LCM by the identity has the fastest reliable hand method for any pair, and the fold extends it to any count. The identity is also the fastest diagnostic in the subject: given a claimed LCM and GCF for a pair, multiply them, and if the product is not a × b, at least one claim is false, with no further work needed to know that.
Worked problems, both concepts in the same room
Problem one, cycles: two traffic lights cycle every 12 and 18 seconds. They turn green together now. When do they next turn green together? The answer must be larger than both periods, so it is the LCM, 36 seconds. The GCF, 6, answers a different question entirely, the largest interval that divides both cycles evenly, which is true but irrelevant here. Problem two, tiling: a rectangle 12 units by 18 units is to be tiled with identical squares, as large as possible, with no cutting. The answer must be smaller than both sides, so it is the GCF, 6, giving squares of 6 by 6, two across and three down. The LCM, 36, would describe a square that covers the rectangle three times over, which is not the question asked. Problem three, fractions: simplify 12/18 and add 1/12 and 1/18. Simplifying divides by the GCF, 6, giving 2/3. Adding uses the LCM, 36, as the denominator, giving 3/36 plus 2/36 equals 5/36. One problem, both concepts, each in its own step, and the two answers, 2/3 and 5/36, are related only through the numbers they came from.
Problem four, sharing: 12 apples and 18 oranges are to be packed into identical bags, the same mix in every bag, no fruit left over, and as few bags as possible. The number of bags must divide both counts, and the largest number of bags that does so is the GCF, 6, giving 6 bags each holding 2 apples and 3 oranges, 12 divided by 6 and 18 divided by 6. Fewer bags would mean larger bags, but 5 bags cannot split 12 apples evenly, and more bags would mean smaller bags than the largest possible identical mix. The LCM, 36, answers a different question, the smallest number divisible by both counts, which has nothing to do with packing fruit. Problem five, schedules: a 4-day rota and a 6-day rota starting together repeat together every 12 days, the LCM, while the largest shift pattern dividing both rotas is 2 days, the GCF, which describes their shared structure rather than their next meeting. Direction decides, every time.
Checking, and the common errors
The checking habit for this subject is short and complete. For a pair, verify divisibility both ways, the LCM is divisible by each input, and the GCF divides each input, verify extremeness, no smaller common multiple and no larger common factor, and verify the product identity, LCM × GCF = a × b. For a triple or more, verify divisibility and extremeness directly, since the product identity does not extend. The common errors are all direction errors, and they all fail one of these checks visibly. Answering 6 for LCM(12, 18) fails divisibility, since 6 is not divisible by 12. Answering 216 for LCM(12, 18) passes divisibility but fails leastness, since 36 is smaller and also divisible by both. Answering 36 for GCF(12, 18) fails the factor check, since 36 does not divide 12. Answering with the product when the numbers share a factor fails leastness for the LCM and fails the identity for the pair. Each error is a confusion of direction, and each is caught by asking, before computing, whether the answer should be bigger or smaller than the inputs.
Keep the two concepts in one mental picture and they stop competing. The GCF carves inward to the largest shared piece, the LCM builds outward to the smallest shared whole, prime factorization reads the same primes in opposite directions to produce both, Euclid finds the inward number and the product identity converts it to the outward one, and the calculator on this site displays both because a pair of numbers is only fully described by both. Work problems by asking the direction question first, computing second, and checking third, and the distinction, which feels slippery in definitions, becomes automatic in practice.
Frequently asked questions
What is the difference between LCM and GCF?
The LCM is the smallest number your inputs all divide into, so it is larger than the inputs, while the GCF is the largest number that divides all of your inputs, so it is smaller. For 12 and 18, the LCM is 36 and the GCF is 6. Use the LCM when cycles align or fractions share a denominator, and the GCF when splitting into equal groups or simplifying a fraction.
How are LCM and GCF related?
For any pair of positive whole numbers, LCM times GCF equals a times b. For 12 and 18, 36 times 6 equals 216, which is 12 times 18. The identity lets you find one from the other, and it checks any computed pair: if the product does not equal a times b, at least one value is wrong. The identity does not extend to three or more numbers in the same simple form.
When do I use LCM and when do I use GCF?
Ask whether the answer should be bigger or smaller than the inputs. Bigger means LCM: when things next coincide, or a common denominator. Smaller means GCF: the largest equal pieces, or simplifying a fraction. Words like together and again point to the LCM, while largest, equally, and simplify point to the GCF. When a problem is ambiguous, compute both and state both.
What is the GCF of 12 and 18?
6. The factors of 12 are 1, 2, 3, 4, 6, and 12, and the factors of 18 are 1, 2, 3, 6, 9, and 18, so the largest factor they share is 6. By prime factorization, 12 is 2 squared times 3 and 18 is 2 times 3 squared, and taking the lowest powers gives 2 times 3 equals 6. By Euclid’s algorithm, 18 divided by 12 leaves 6, and 12 divided by 6 leaves 0, so the last nonzero remainder is 6.
What is the LCM of 12 and 18?
36. Multiples of 12 are 12, 24, and 36, and multiples of 18 are 18 and 36, so 36 is the first shared multiple. By prime factorization, taking the highest powers gives 2 squared times 3 squared equals 36. By the GCD method, 12 times 18 divided by the GCF of 6 equals 216 divided by 6 equals 36. The check is 36 times 6 equals 216, which is 12 times 18.
Is the GCF ever larger than the LCM?
No, never, for positive whole numbers. The GCF is at most the smallest input, and the LCM is at least the largest input, so the GCF is always less than or equal to the LCM. They are equal only when the inputs are equal, as with LCM of 9 and 9 equals 9 and GCF of 9 and 9 equals 9. If a calculation gives a GCF larger than the LCM, the two have been swapped or miscomputed.
Try it on the calculator
Enter your numbers and read the LCM and the GCF together, with the steps that produced both.
Open the LCM Calculator →- 1How to Find the LCM: Listing, Prime Factors, the GCD Method, and the Ladder
Four methods, one answer: LCM(12, 18) = 36 by listing, by highest prime powers, by a times b divided by the…
- 2Fraction Calculator
Add and simplify fractions.
- 3Factor Calculator
Every factor of a number.
- 4Percentage Calculator
Percent of anything.
