GCF and LCM Calculator

Enter two whole numbers, then press Find the GCF and LCM.

GCF and LCM Calculator: Find the Greatest Common Factor and Least Common Multiple

A GCF & LCM Calculator finds the greatest common factor and the least common multiple of two whole numbers in seconds. Enter your numbers, and it shows both answers with clear steps, so you can check homework, simplify fractions, or plan equal groups without working through prime factors by hand.

GCF and LCM Calculator

I first reached for a GCF & LCM Calculator on a school night, when my niece came home with a worksheet that mixed fraction problems with find-the-GCF-and-LCM questions. She had the idea right but kept losing track of the factors halfway through. I typed her two numbers into the GCF & LCM Calculator, and it showed the GCF and the LCM with the steps laid out, so we could see where her working had gone wrong instead of just copying an answer. That is still how I use it: as a quick check that shows its working, not as a shortcut that hides it. The CalcSolver tool is free, it takes two whole numbers at a time, and it shows the steps behind both answers, which makes it useful for homework, for teachers putting together practice sheets, and for anyone who needs both numbers fast.

Here is what you get. You enter a first number and a second number, press calculate, and the GCF & LCM Calculator returns both results on one screen: the greatest common factor and the least common multiple, plus the steps it used. If you are looking for a GCF LCM calculator online, the CalcSolver tool is free and there is nothing to download. Think of it as a GCF and LCM finder that shows its working, not a black box. Used as a GCF calculator, it is handy for simplifying fractions, and it also works well as a plain LCM calculator when you only need the multiple side of the answer.

One honest note before you start. The CalcSolver tool works on two numbers at a time, so a list of three or more numbers needs a different approach: work them in pairs by hand, which I explain in the calculation section below. The GCF & LCM Calculator still helps there, because you can check each pair as you go. Students use it to check homework, teachers use it to build answer keys, and parents use it to keep up with 7th grade math. The GCF and LCM Calculator on CalcSolver keeps the whole thing simple: two numbers in, both answers out, steps included.

How to Use the GCF and LCM Calculator?

Using the GCF & LCM Calculator takes less than a minute once you know the three steps. I have run dozens of pairs through it, and the routine below is the one I actually follow, including the small checks that catch typing mistakes before they turn into wrong answers.

1. Enter two whole numbers. Type your first number in the First number box and your second number in the Second number box. Whole numbers are what the GCF & LCM Calculator is built for, so if your problem gives you a decimal, convert it to a whole number first or work that part by hand. Double-check the digits before you move on, because a mistyped 36 for 63 will give you a perfectly correct answer to the wrong question. A good GCF and LCM finder shows steps you can follow, and this one does, which makes it easy to spot a slip.

2. Calculate the GCF and LCM. Press the calculate button and the GCF & LCM Calculator works out both answers at once. There is nothing to install with a GCF LCM calculator online like this one, and the results appear on the same page, so you can run a second pair straight away if you need to compare answers. If you only need the multiple, you can still use it as an LCM calculator and ignore the GCF line. Treat the GCF and LCM solver as a checker, not a crutch: try the pair by hand first when you are learning, then compare.

3. Understand and interpret your results. The results screen shows the GCF, the LCM, and the steps behind them. Read the steps, not just the final numbers. The GCF should divide both of your numbers exactly, and the LCM should be divisible by both of them, so those two checks take seconds and catch most mistakes. If the GCF comes out as 1, your numbers are coprime, which means they share no common factor except 1, and the LCM will simply be the product of the two numbers. Keep that habit of checking, and the GCF & LCM Calculator becomes a study tool instead of just an answer machine.

What Are GCF and LCM?

Before you trust any answer, it helps to know what the two numbers mean. I used to mix them up myself: the GCF is about splitting things down, and the LCM is about lining things up. Once that picture stuck, the methods made sense. A GCF & LCM Calculator gives you both answers together because the two ideas are partners, and most real problems need one or the other, rarely both at once.

One picture that helped me is the Venn diagram. Draw two overlapping circles, one for each number, and write the prime factors of each number in its circle, with the shared primes in the overlap. The overlap gives you the GCF, because it holds the factors the numbers share, and all the primes across both circles give you the LCM. For 18 and 27, the overlap holds 3 squared, which is 9, and the full picture holds 2 times 3 cubed, which is 54. I sketch this on paper when I am teaching the idea, because it turns an abstract rule into something you can point at.

What Is the Greatest Common Factor (GCF)?

Take 18 and 27. The factors of 18 are 1, 2, 3, 6, 9, and 18. The factors of 27 are 1, 3, 9, and 27. The numbers that appear in both lists are 1, 3, and 9, and the greatest of those is 9, so the GCF of 18 and 27 is 9. That is the whole idea: list the factors of each number, keep the ones they share, and pick the biggest.

The GCF is also called the greatest common divisor, or GCD, and in some classrooms you will hear HCF, the highest common factor. All three names mean the same thing. It is the largest whole number that divides both numbers exactly, with nothing left over. The GCF can never be bigger than the smaller of your two numbers, and when the two numbers are equal, the GCF is the number itself.

The GCF shows up whenever you split something into the largest equal pieces: cutting ribbon, grouping students, or simplifying a fraction. In the fraction 18/27, for example, dividing the top and bottom by the GCF of 9 gives 2/3, which is the same value in its simplest form.

What Is the Least Common Multiple (LCM)?

Now look at 14 and 35. The multiples of 14 are 14, 28, 42, 56, 70, 84, and so on. The multiples of 35 are 35, 70, 105, and so on. The first number that appears in both lists is 70, so the LCM of 14 and 35 is 70. That is the whole idea: list the multiples of each number and take the smallest one they share.

The LCM can never be smaller than the larger of your two numbers, and when one number divides the other, the LCM is simply the larger number. It is the smallest whole number that both numbers divide into exactly.

The LCM shows up whenever repeating things need to line up: two machines that beep on different cycles, lights that flash on different timers, or fractions that need a common denominator. I check this kind of answer with the GCF & LCM Calculator because listing multiples by hand gets slow once the numbers grow, and one missed multiple can throw the whole list off.

Difference Between GCF and LCM

The shortest way to keep them apart is direction. The GCF breaks numbers down into the biggest shared piece, while the LCM builds them up to the smallest shared whole. The GCF divides both numbers; the LCM is divided by both numbers. The GCF is small, never larger than the smaller number, and the LCM is big, never smaller than the larger number.

Take 18 and 27 again. Their GCF is 9 and their LCM is 54. The 9 is a factor of both numbers, while the 54 is a multiple of both numbers. The same pair gives you both answers, and the two answers sit on opposite sides of the numbers you started with.

QuestionGCFLCM
What it findsThe largest factor shared by both numbersThe smallest multiple shared by both numbers
SizeNever larger than the smaller numberNever smaller than the larger number
18 and 27954
14 and 35770
Typical useSplitting into equal groups, simplifying fractionsLining up cycles, finding a common denominator

One more useful fact: if the GCF of two numbers is 1, the numbers are coprime, or relatively prime, and their LCM is just their product. The numbers 9 and 28 are coprime, so their GCF is 1 and their LCM is 252, which is 9 times 28.

How to Calculate GCF and LCM?

There are four ways to find these numbers by hand, and each one suits a different size of problem. I use listing for small numbers, prime factorization when the numbers are mid-sized, and the Euclidean algorithm when they get big. A GCF & LCM Calculator follows the same logic, so learning the steps by hand also teaches you what the tool is doing behind the scenes.

Choosing a method is half the battle. If the numbers are small enough to list on one line, listing is the fastest way to an answer you trust. If your teacher asks to see working, prime factorization shows every step in one picture. And if the numbers are large, the Euclidean algorithm plus the product rule will beat listing every time, because the lists would run off the page. I usually try prime factorization first and switch to the Euclidean algorithm when the factoring stalls.

How to Find the GCF of Two or More Numbers?

For small numbers, list the factors. The factors of 6 are 1, 2, 3, and 6, and the factors of 10 are 1, 2, 5, and 10. The shared factors are 1 and 2, so the GCF of 6 and 10 is 2. That method is simple, but it gets slow once the numbers pass 100, because the factor lists get long and easy to fumble.

For bigger numbers, the Euclidean algorithm is faster. It uses division and remainders instead of long lists. To find the GCF of 45 and 60, divide 60 by 45: you get 1 with a remainder of 15. Then divide 45 by 15: you get 3 with a remainder of 0. The last non-zero remainder is the GCF, so the GCF of 45 and 60 is 15. The method works because any common factor of the two numbers must also divide the remainder, so each step shrinks the problem without changing the answer.

For three or more numbers, work in pairs. The GCF of 6, 10, and 15 is found by taking the GCF of the first two numbers, which is 2, and then the GCF of 2 and 15, which is 1. So the GCF of 6, 10, and 15 is 1. A GCF & LCM Calculator saves the most time when the numbers get big, and a GCF calculator that shows steps lets you follow the pair-by-pair rule for a list of any length.

How to Find the LCM of Two or More Numbers?

For small numbers, list the multiples. The multiples of 6 are 6, 12, 18, 24, and 30, and the multiples of 10 are 10, 20, and 30. The first multiple they share is 30, so the LCM of 6 and 10 is 30. That method is fine for small numbers, but it turns into a chore when the LCM is large.

The faster route uses the GCF. The LCM of two numbers equals their product divided by their GCF. For 14 and 35, the product is 490 and the GCF is 7, so the LCM is 490 divided by 7, which is 70. That one division replaces a long list of multiples, and it is the method I reach for most often by hand.

For three or more numbers, work in pairs again. The LCM of 6, 10, and 15 is found by taking the LCM of 6 and 10, which is 30, and then the LCM of 30 and 15, which is 30. So the LCM of 6, 10, and 15 is 30. The pair-by-pair rule works for both the GCF and the LCM, and it is the reason a two-number GCF & LCM Calculator can still help with longer lists: check each pair in turn, then carry the result into the next pair.

Finding GCF and LCM Using Prime Factorization

Prime factorization breaks each number into its prime building blocks, and then the GCF and LCM fall out of the same picture. Take 45 and 60. The prime factorization of 45 is 3² × 5, and the prime factorization of 60 is 2² × 3 × 5. For the GCF, take each prime that appears in both numbers at its lowest power: 3 times 5, which is 15. For the LCM, take every prime that appears in either number at its highest power: 2² × 3² × 5, which is 180. One factorization gives you both answers, which is why textbooks teach this method first.

The method also makes coprime pairs obvious. The number 9 is 3² and 28 is 2² × 7, so they share no prime factors at all. Their GCF is 1 and their LCM is 252, the product of the two numbers. A GCF and LCM solver follows the same steps you would use by hand, which is why the steps it shows look familiar once you have done a few by hand.

Finding GCF and LCM Using the Listing Method

The listing method is the slowest method and also the easiest to understand, which is why it is the best place to start. To find the GCF of 21 and 30, list the factors of 21, which are 1, 3, 7, and 21, and the factors of 30, which are 1, 2, 3, 5, 6, 10, 15, and 30. The shared factors are 1 and 3, so the GCF is 3.

GCF and LCM Calculator showing overlapping factor circles beside a calculator on a dark navy grid
Two numbers in, both answers out: a GCF and LCM calculator returns the greatest common factor and the least common multiple with steps.

To find the LCM of the same pair, list the multiples of 21, which are 21, 42, 63, 84, 105, 126, 147, 168, 189, and 210, and the multiples of 30, which are 30, 60, 90, 120, 150, 180, and 210. The first multiple they share is 210, so the LCM of 21 and 30 is 210. Ten multiples in, the list finally meets, and that is the weakness of the method: the answer can be a long way down the page.

Use listing when the numbers are small and you are learning, and switch to prime factorization or the GCF division method when the lists get long. I still use listing to double-check a GCF & LCM Calculator result when the numbers are small, because two different methods that agree are worth more than one fast answer.

GCF and LCM Formulas and Equations

The formulas in this section are short, and each one is worth memorizing, because they turn a long listing job into a single line of arithmetic. I keep the product rule on a sticky note above my desk, and it has saved me more than once. A GCF & LCM Calculator applies these same formulas, so the steps it shows should match the working in this section.

Greatest Common Factor (GCF) Formula

The GCF formula comes in two useful forms. From prime factorization, the GCF is the product of the primes the numbers share, each taken at its lowest power. For 45 and 60, the shared primes are 3 and 5, each at power 1, so the GCF is 3 times 5, which is 15.

The second form uses the LCM: GCF(a, b) equals a times b divided by LCM(a, b). For 14 and 35, the product is 490 and the LCM is 70, so the GCF is 490 divided by 70, which is 7. That form is handy when you already know the LCM and need the GCF in a hurry. Once you know the GCF, the LCM is one division away, which is why a good LCM calculator shows both answers together.

Least Common Multiple (LCM) Formula

The LCM formula is the mirror image. From prime factorization, the LCM is the product of every prime that appears in either number, each taken at its highest power. For 45 and 60, that is 2² × 3² × 5, which is 180.

The second form uses the GCF: LCM(a, b) equals a times b divided by GCF(a, b). For 18 and 27, the product is 486 and the GCF is 9, so the LCM is 486 divided by 9, which is 54. That form is the one I use most by hand, because finding the GCF with the Euclidean algorithm is usually quicker than listing multiples. If you remember only one formula from this page, make it this one.

Relationship Between GCF and LCM

The two answers are linked by a simple rule: for any two whole numbers, GCF times LCM equals the product of the numbers. For 18 and 27, the GCF is 9 and the LCM is 54, and 9 times 54 is 486, which is exactly 18 times 27. For 14 and 35, the GCF is 7 and the LCM is 70, and 7 times 70 is 490, which is exactly 14 times 35.

That rule is a built-in answer check. If your GCF times your LCM does not equal the product of your two numbers, one of the answers is wrong, and you can find the mistake before it spreads into the rest of the problem. I use it every time I work by hand, and it is the first thing I check when a GCF & LCM Calculator result looks surprising.

One warning: the rule only holds for two numbers. For 6, 10, and 15, the GCF is 1 and the LCM is 30, but 1 times 30 is 30, not 900, which is the product of all three. With three or more numbers, stick to the pair-by-pair method instead.

GCF and LCM Examples With Step-by-Step Solutions

Worked examples are where the methods stop being theory, so this section solves each problem from start to finish. I have done every one of these by hand first, then checked them with the GCF & LCM Calculator, and the answers match what the tool shows.

What Is the GCF of 8, 36, and 12?

Step 1: factor each number into primes. The number 8 is 2³. The number 36 is 2² × 3². The number 12 is 2² × 3. Take care with 36: it is 2² × 3², not 2² × 3³, a slip I have seen in print more than once.

Step 2: keep the primes that appear in all three numbers. Only the prime 2 appears in every factorization, so the GCF is a power of 2.

Step 3: take the lowest power. The powers of 2 are 3, 2, and 2, so the lowest is 2², which is 4. The GCF of 8, 36, and 12 is 4.

Check it with the pair-by-pair method. The GCF of 8 and 36 is 4, and the GCF of 4 and 12 is 4, which agrees. You can also check it by listing: the factors of 8 are 1, 2, 4, and 8, the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, and 36, and the factors of 12 are 1, 2, 3, 4, 6, and 12. The shared factors are 1, 2, and 4, so the GCF is 4. Run the pairs through a GCF & LCM Calculator afterwards and the answers will match.

How to Find the LCM of 8, 36, and 12?

Step 1: use the same prime factorizations. The number 8 is 2³, 36 is 2² × 3², and 12 is 2² × 3.

Step 2: take every prime at its highest power. The highest power of 2 is 2³, from the 8, and the highest power of 3 is 3², from the 36. Multiply them: 2³ × 3² is 8 times 9, which is 72. The LCM of 8, 36, and 12 is 72.

Check it with the pair-by-pair method. The LCM of 8 and 36 is 72, and the LCM of 72 and 12 is 72, which agrees. You can also check it by division: 72 divided by 8 is 9, 72 divided by 36 is 2, and 72 divided by 12 is 6, all whole numbers with nothing left over. That divisibility check is the fastest way to confirm any LCM, and it is the check I run first whenever an answer looks too big or too small. Use a GCF and LCM finder to check each step, or run each pair through the GCF & LCM Calculator, if you want a second opinion.

Solved GCF and LCM Examples Using Prime Factorization

Example 1: 15 and 40. The prime factorization of 15 is 3 × 5, and the prime factorization of 40 is 2³ × 5. The only shared prime is 5, so the GCF is 5. For the LCM, take every prime at its highest power: 2³ × 3 × 5, which is 8 times 15, which is 120. Check with the product rule: 5 times 120 is 600, and 15 times 40 is 600.

Example 2: 21 and 30. The prime factorization of 21 is 3 × 7, and the prime factorization of 30 is 2 × 3 × 5. The only shared prime is 3, so the GCF is 3. For the LCM, take every prime at its highest power: 2 × 3 × 5 × 7, which is 210. Check with the product rule: 3 times 210 is 630, and 21 times 30 is 630.

Example 3: three numbers, 9, 12, and 18. The prime factorization of 9 is 3², of 12 is 2² × 3, and of 18 is 2 × 3². The only prime in all three is 3, at its lowest power of 1, so the GCF is 3. For the LCM, take 2² × 3², which is 36. Run each pair through a GCF and LCM solver after you finish by hand, and the answers will match the GCF & LCM Calculator exactly.

When to Use GCF and LCM in Real Life?

These two ideas sound like classroom math until you notice how often they turn up outside school. I have used both in the kitchen, in the garden, and on worksheets, and the examples below are the ones that actually come up.

Teachers lean on the same ideas when they plan lessons. A teacher splitting a class into equal teams uses the GCF, and a teacher lining up two repeating review cycles uses the LCM. I have seen the same thinking in DIY projects too: anyone laying square tiles across a rectangular floor, or spacing fence posts evenly along two different lengths, is solving a GCF problem whether they call it that or not.

Everyday Applications of GCF

The GCF answers one question: what is the biggest equal piece I can cut? Say you have a ribbon 45 inches long and another 60 inches long, and you want equal pieces with nothing left over. The GCF of 45 and 60 is 15, so you cut both ribbons into 15 inch pieces: three pieces from the first ribbon and four from the second.

The same idea packs boxes. If you have 42 muffins and 70 cookies to pack into identical boxes with no treats left over, the GCF of 42 and 70 is 14, so each box holds 14 treats: three boxes of muffins and five boxes of cookies.

The GCF also simplifies fractions, which is its most common everyday use. The fraction 18/27 becomes 2/3 when you divide the top and bottom by their GCF of 9. A GCF calculator is the quick way to find the biggest equal piece size when the numbers are awkward, and a quick check with the GCF & LCM Calculator confirms the pieces before you start cutting.

Everyday Applications of LCM

The LCM answers a different question: when do repeating things line up? Say two machines in a workshop beep every 14 minutes and every 35 minutes. They beep together every 70 minutes, which is the LCM of 14 and 35, so a worker who hears them together knows the next joint beep is 70 minutes away.

The LCM also sorts out party shopping. Plates come in packs of 9 and cups in packs of 15, and you want the same number of each. The LCM of 9 and 15 is 45, so you buy five packs of plates and three packs of cups, and nothing is left over.

The third everyday use is adding fractions. To add 1/6 and 1/8, you need a common denominator, which is the LCM of 6 and 8, or 24. The sum becomes 4/24 plus 3/24, which is 7/24. That is when an LCM calculator earns its keep, and a GCF LCM calculator online is also handy outside homework, for schedules, shopping, and craft projects alike. I run the numbers through the GCF & LCM Calculator first, then buy or cut with confidence.

Frequently Asked Questions

These are the questions I hear most often from students and parents, answered in plain words.

What Is the Difference Between GCF and LCM?

The GCF is the largest number that divides both numbers exactly, while the LCM is the smallest number that both numbers divide into exactly. For 18 and 27, the GCF is 9 and the LCM is 54. Use the GCF to split things into equal pieces and the LCM to line up repeating events.

How Do I Calculate the GCF?

List the factors of each number and pick the largest one they share, or use prime factorization and take the shared primes at their lowest powers. For bigger numbers, the Euclidean algorithm is faster. A GCF & LCM Calculator shows each step, so check your answer against it.

How Do I Calculate the LCM?

List the multiples of each number and take the smallest one they share, or divide the product of the numbers by their GCF. For 14 and 35, the product is 490 and the GCF is 7, so the LCM is 70. The division method is much faster once the numbers grow.

Can I Find the GCF and LCM of More Than Two Numbers?

Yes, by hand. Work in pairs: find the GCF of the first two numbers, then find the GCF of that answer and the next number, and repeat. The same pair-by-pair rule works for the LCM. The CalcSolver GCF & LCM Calculator takes two numbers at a time, so check each pair in turn.

Can the GCF Be Greater Than the LCM?

No. The GCF is never larger than the smaller of your two numbers, and the LCM is never smaller than the larger one, so the GCF can never pass the LCM. The two are equal only when the numbers themselves are equal, as with 15 and 15, where both answers are 15.

Is the GCF of Two Prime Numbers Always 1?

Yes, for two different prime numbers. A prime number has only two factors, 1 and itself, so two different primes share nothing but 1. For 7 and 13, the GCF is 1 and the LCM is 91. The only exception is a prime paired with itself, where the GCF is the prime.

What Happens When One Number Is a Multiple of Another?

Then the smaller number is the GCF and the larger number is the LCM. For 10 and 30, the GCF is 10 and the LCM is 30, because 30 is a multiple of 10. The same holds for 12 and 36. Spotting this pattern saves you a full calculation every time.

The GCF and the LCM are small ideas with a long reach, from simplifying fractions to lining up schedules, and the fastest way to get comfortable with them is to work a few pairs by hand and then check your answers. Keep this GCF and LCM finder bookmarked, whether you need a GCF calculator for fractions or a GCF LCM calculator online for a quick pair check, and let the steps it shows teach you the method as you go. The GCF & LCM Calculator is free, it takes two numbers at a time, and it shows its working. Try the GCF & LCM Calculator on your next problem, and use the pair-by-pair rule whenever your list runs longer than two numbers. This GCF and LCM solver will not replace practice, but it will make practice faster and far less frustrating.