LCM & GCF Calculator: Least Common Multiple, Greatest Common Factor, Formulas & Examples
Use this LCM and GCF calculator to find the least common multiple and greatest common factor of two or more positive whole numbers. Enter your numbers separated by commas, spaces, or line breaks, and the calculator will return the LCM, the GCF, and a short calculation summary.
The LCM is the smallest positive number that all the given numbers divide into evenly. The GCF, also called the GCD or HCF, is the largest positive number that divides all the given numbers evenly. These two ideas appear in fraction operations, number theory, algebra, ratio problems, scheduling problems, and many school mathematics topics.
This calculator is designed for positive whole numbers. For classroom and exam-style problems, enter integers such as 12, 18, 24.
LCM & GCF Calculator
What Are LCM and GCF?
LCM and GCF are two of the most useful ideas in whole-number arithmetic. They both compare numbers through divisibility, but they answer opposite kinds of questions. The least common multiple asks, “What is the smallest number that all of these numbers can divide into?” The greatest common factor asks, “What is the largest number that divides all of these numbers?”
The least common multiple, or LCM, is the smallest positive multiple shared by two or more numbers. For example, the multiples of 6 are 6, 12, 18, 24, 30, 36, and so on. The multiples of 8 are 8, 16, 24, 32, 40, and so on. The smallest multiple that appears in both lists is 24, so \( \mathrm{LCM}(6,8)=24 \).
The greatest common factor, or GCF, is the largest factor shared by two or more numbers. For example, the factors of 18 are 1, 2, 3, 6, 9, and 18. The factors of 24 are 1, 2, 3, 4, 6, 8, 12, and 24. The greatest factor that appears in both lists is 6, so \( \mathrm{GCF}(18,24)=6 \).
GCF is also commonly called GCD, which means greatest common divisor, or HCF, which means highest common factor. These names mean the same thing in most school mathematics contexts. In this guide, GCF, GCD, and HCF all refer to the largest whole number that divides the given numbers with no remainder.
LCM and GCF Formulas
For two positive integers, LCM and GCF are connected by a powerful formula. If \(a\) and \(b\) are positive whole numbers, then:
This formula can be rearranged to find the least common multiple when the greatest common factor is known:
The absolute value symbol \(|a\times b|\) is used in the general integer formula, but in typical school problems with positive numbers, the product is already positive. For example, if \(a=12\) and \(b=18\), the GCF is 6. Therefore:
For more than two numbers, the calculator applies the same logic pair by pair. For example:
This pair-by-pair method makes it possible to calculate LCM and GCF for any list of positive whole numbers, not only for two numbers.
How to Use the LCM & GCF Calculator
This calculator is built for quick answers and educational clarity. You can use it for homework, checking fraction work, preparing examples, comparing number sets, or solving practical scheduling problems.
- Choose the calculation type. Select whether you want both LCM and GCF, only LCM, or only GCF.
- Enter positive whole numbers. Type two or more integers. You can separate them using commas, spaces, or line breaks.
- Check that the values are valid. The calculator expects positive whole numbers such as 8, 12, 18, and 24.
- Click Calculate. The calculator returns the least common multiple, greatest common factor, or both depending on your selected mode.
- Read the explanation line. The explanation line tells you what the result means for your exact numbers.
- Use the guide below for steps. If you need to show work, use the prime factorization method, listing method, or Euclidean algorithm explained below.
Quick classroom tip: Use LCM when you need a common denominator or a repeated event match. Use GCF when you need to simplify, split into equal groups, or factor an expression.
LCM vs GCF: What Is the Difference?
LCM and GCF are easy to confuse because both involve the words “common” and both compare two or more numbers. The difference is in the direction of the calculation. LCM looks upward through multiples. GCF looks downward through factors.
| Idea | LCM | GCF |
|---|---|---|
| Full name | Least Common Multiple | Greatest Common Factor |
| Main question | What is the smallest shared multiple? | What is the largest shared factor? |
| Direction | Looks upward at multiples | Looks downward at factors |
| Typical use | Common denominators, repeated schedules, cycles | Simplifying fractions, grouping, factoring |
| Example with 12 and 18 | \(\mathrm{LCM}(12,18)=36\) | \(\mathrm{GCF}(12,18)=6\) |
| Result size | Usually greater than or equal to each number | Usually less than or equal to each number |
A simple way to remember the difference is this: LCM is for meeting at a shared multiple; GCF is for dividing into shared equal parts. If two traffic lights repeat every 12 seconds and 18 seconds, LCM tells when they flash together again. If you have 12 red cards and 18 blue cards and want identical groups, GCF tells the greatest number of equal groups you can make.
Method 1: Finding LCM by Listing Multiples
The listing method is one of the easiest ways to understand LCM. It is best for small numbers because you can write out multiples until you find the first shared value.
Example: Find \(\mathrm{LCM}(6,8)\).
The first number that appears in both lists is 24, so:
This method is very clear, but it can become slow when the numbers are large or when the LCM is far away. For example, listing multiples for 48 and 180 would take more time than using prime factorization or the GCF formula. That is why calculators and advanced methods are useful.
Method 2: Finding GCF by Listing Factors
The listing method for GCF works by writing all factors of each number and choosing the largest shared factor. It is excellent for learning the concept because you can see exactly which factors are common.
Example: Find \(\mathrm{GCF}(18,24)\).
The common factors are:
The greatest common factor is 6, so:
Like listing multiples, listing factors is simple but can be slow for large numbers. It works well for small classroom examples, but the Euclidean algorithm is more efficient for larger values.
Method 3: Prime Factorization for LCM and GCF
Prime factorization is one of the best methods because it finds both LCM and GCF from the same breakdown. A prime factorization writes each number as a product of prime numbers. Then you compare prime powers.
Example: Find the LCM and GCF of 12, 18, and 24.
To find the LCM, take each prime factor using the highest exponent that appears in any number. The highest power of 2 is \(2^3\), and the highest power of 3 is \(3^2\). Therefore:
To find the GCF, take only the prime factors that appear in every number, using the lowest exponent shared by all. The lowest power of 2 is \(2^1\), and the lowest power of 3 is \(3^1\). Therefore:
This method is powerful because it shows the structure of the numbers. LCM uses the largest powers needed to include all numbers. GCF uses the smallest powers shared by all numbers.
Method 4: Euclidean Algorithm for GCF
The Euclidean algorithm is an efficient method for finding the GCF of two numbers. It uses repeated division and remainders. The key idea is that the GCF of two numbers does not change if the larger number is replaced by its remainder after division by the smaller number.
Example: Find \(\mathrm{GCF}(48,180)\).
The last nonzero remainder is 12, so:
Once the GCF is known, the LCM can be found using the two-number relationship:
This is the type of logic used by many calculators because it is fast, accurate, and does not require listing all factors or all multiples.
Worked Examples
Example 1: Find the LCM and GCF of 12 and 18
First write the prime factorization:
For the GCF, use the shared prime factors with the lowest exponents:
For the LCM, use all prime factors with the highest exponents:
Example 2: Find the LCM and GCF of 8, 12, and 20
Prime factorize each number:
The GCF uses only the prime factors shared by all three numbers. The only shared prime factor is 2, and the smallest exponent is \(2^2\), so:
The LCM uses all prime factors with the highest exponent:
Example 3: Use LCM to add fractions
Suppose you need to add:
The denominators are 6 and 8. The least common denominator is the LCM of 6 and 8:
Convert both fractions to denominator 24:
Example 4: Use GCF to simplify a fraction
Suppose you want to simplify:
Find the GCF:
Divide the numerator and denominator by 12:
When Should You Use LCM?
Use the least common multiple when you need a shared cycle, a common denominator, or the smallest number that multiple values divide into evenly. In school mathematics, the most common use of LCM is finding a least common denominator for adding or subtracting fractions.
LCM is also useful for repeated events. Suppose one bus arrives every 12 minutes and another bus arrives every 18 minutes. If both buses arrive now, the LCM tells when they will arrive together again. Since \(\mathrm{LCM}(12,18)=36\), they will arrive together again in 36 minutes.
LCM also appears in patterns, gears, rotations, blinking lights, repeating alarms, music rhythm, and scheduling. Whenever two or more cycles repeat at different intervals, the least common multiple tells the first time they line up again.
When Should You Use GCF?
Use the greatest common factor when you need to divide values into equal groups, simplify fractions, factor expressions, or find the largest shared unit. GCF is about breaking numbers down into the largest equal pieces possible.
For example, suppose you have 24 apples and 36 oranges and want to make identical gift bags without leftovers. The GCF of 24 and 36 is 12, so you can make 12 identical bags. Each bag would contain:
GCF is also essential in algebra. When factoring an expression such as \(12x+18\), the GCF of 12 and 18 is 6, so:
This is why GCF is an important bridge between arithmetic and algebra.
Common Mistakes with LCM and GCF
Mistake 1: Confusing multiples and factors
Factors divide into a number. Multiples are produced by multiplying a number. GCF uses factors. LCM uses multiples.
Mistake 2: Choosing the largest common multiple
There is no largest common multiple because multiples continue forever. LCM means the smallest positive common multiple.
Mistake 3: Choosing the smallest common factor
The smallest common factor is usually 1. GCF means the greatest common factor, not the first shared factor.
Mistake 4: Using the two-number formula for many numbers directly
The formula \(\mathrm{LCM}(a,b)=\frac{ab}{\mathrm{GCF}(a,b)}\) applies directly to two numbers. For more numbers, apply it pair by pair.
LCM and GCF Reference Table
| Numbers | GCF | LCM | Reason |
|---|---|---|---|
| 6 and 8 | 2 | 24 | 2 is the greatest shared factor, and 24 is the first shared multiple. |
| 12 and 18 | 6 | 36 | \(12=2^2\times3\), \(18=2\times3^2\). |
| 15 and 25 | 5 | 75 | They share factor 5; LCM uses \(3\times5^2\). |
| 8, 12, and 20 | 4 | 120 | Prime factorization gives GCF \(2^2\) and LCM \(2^3\times3\times5\). |
| 9 and 28 | 1 | 252 | They are relatively prime, so the LCM is their product. |
FAQ: LCM & GCF Calculator
What does this LCM and GCF calculator do?
It calculates the least common multiple and greatest common factor of two or more positive whole numbers. You can enter numbers separated by commas, spaces, or line breaks.
What is the difference between LCM and GCF?
LCM means least common multiple. It is the smallest positive multiple shared by the numbers. GCF means greatest common factor. It is the largest number that divides all the given numbers evenly.
What is another name for GCF?
GCF is also called GCD, which means greatest common divisor, and HCF, which means highest common factor. These terms usually mean the same thing.
What is the formula for LCM using GCF?
For two positive integers, the formula is \(\mathrm{LCM}(a,b)=\frac{a\times b}{\mathrm{GCF}(a,b)}\).
Can the LCM be smaller than the original numbers?
For positive whole numbers, the LCM is always greater than or equal to the largest number in the set. It cannot be smaller than a number it must be a multiple of.
Can the GCF be larger than the original numbers?
No. The GCF cannot be larger than the smallest number in the set because it must divide every number evenly.
When is the GCF equal to 1?
The GCF is 1 when the numbers have no common factor greater than 1. Such numbers are called relatively prime or coprime.
How do I find the LCM of more than two numbers?
You can find it pair by pair. For example, \(\mathrm{LCM}(a,b,c)=\mathrm{LCM}(\mathrm{LCM}(a,b),c)\).
Related Calculators and Guides
Continue with related tools if your LCM or GCF calculation is part of a larger fraction, algebra, or number theory task.






