This free LCM calculator finds the least common multiple of two or more numbers, and the same page works as a GCF calculator for the greatest common factor. Type your numbers and you get both answers at once, with the prime factors, Euclid’s method and the lists of multiples and factors shown step by step.
Quick answer: The least common multiple (LCM) is the smallest number that every number in your list divides into exactly; the greatest common factor (GCF) is the largest number that divides them all. Example: for 12 and 18 the GCF is 6 and the LCM is 36, and GCF × LCM = 6 × 36 = 216 = 12 × 18.

How to use the LCM calculator and GCF calculator
Type two or more whole numbers with commas or spaces between them, such as 12, 18, 30. The GCF and LCM calculator updates as you type, so there is no Calculate button. Tap one of the example chips to load a classic problem, or choose whether the headline answer should be the GCF, the LCM or both.
- Type the numbers, separated by commas or spaces (up to 12 numbers, each up to 15 digits).
- Read the GCF and the LCM from the GCF and LCM calculator in the big answer and in the boxes below it.
- Check the exponent table: the GCF uses the lowest power of each prime and the LCM uses the highest.
- Open How it works for the prime factors, Euclid’s method, the lists of multiples and factors, and the check line.
| Input or output | What it means | Example (12, 18, 30) |
|---|---|---|
| Numbers | Whole numbers greater than zero | 12, 18, 30 |
| GCF (GCD, HCF) | Largest number that divides every number exactly | 6 |
| LCM | Smallest number that every number divides into | 180 |
| Relatively prime? | Yes when the GCF is 1 | No |
| Exponent table | Powers of each prime in each number | 12 = 2² × 3 |
GCF and LCM calculator examples and a printable prime factor chart
The cards show what the GCF and LCM calculator does, with the three classroom methods: prime factorization, listing multiples and listing factors. The printable chart gives the prime factorization of every number from 2 to 50, which makes finding the LCM and GCF of small numbers quick on paper.




GCF calculator: how to find the greatest common factor
The greatest common factor is the biggest number that goes into each of your numbers with no remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). There are three standard ways to find it, shown here for 24 and 36.
- List the factors. The factors of 24 are 1, 2, 3, 4, 6, 8, 12 and 24; the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18 and 36. The largest number in both lists is 12.
- Use prime factors. 24 = 2 × 2 × 2 × 3 and 36 = 2 × 2 × 3 × 3. They share 2 × 2 × 3 = 12.
- Use Euclid’s method. Divide the bigger number by the smaller and keep the remainder: 36 = 1 × 24 + 12, then 24 = 2 × 12 + 0. The last non-zero remainder, 12, is the GCF.
Computers prefer the Euclidean algorithm because it needs no factoring and works even for very large numbers. The GCF is also what you divide by to simplify a fraction: 24/36 ÷ 12 = 2/3.
LCM calculator: how to find the least common multiple
The least common multiple is the smallest number that is a multiple of every number in the list. The same pair, 24 and 36, shows the three methods.
- List the multiples. Multiples of 24: 24, 48, 72, 96. Multiples of 36: 36, 72, 108. The first number in both lists is 72.
- Use prime factors. Take each prime the greatest number of times it appears in any one number: 2 three times and 3 twice gives 2³ × 3² = 72.
- Use the GCF. For two numbers, LCM = a × b ÷ GCF = 24 × 36 ÷ 12 = 864 ÷ 12 = 72.
For three or more numbers, find the LCM of the first two, then the LCM of that result and the next number. The least common multiple of 12, 18 and 30 is 180, and the LCM calculator does that chain for you.
LCM calculator with steps: worked examples
Each example below matches what the LCM calculator prints for the same numbers, so you can use them to check your own working.
Example 1: LCM and GCF of 12, 18 and 30
12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5. For the GCF keep the primes shared by all three at their lowest power: 2 × 3 = 6. For the LCM take every prime at its highest power: 2² × 3² × 5 = 180. Answer: GCF 6, LCM 180.
Example 2: LCM of 8 and 15 (relatively prime)
8 = 2³ and 15 = 3 × 5 share no prime, so the GCF is 1 and the numbers are relatively prime (coprime). When the GCF is 1 the LCM is simply the product: 8 × 15 = 120.
LCM and GCF ladder method
The ladder method, also called the cake method or the division method, finds both answers in one picture. Write the numbers in a row and divide them by a prime that goes into at least two of them. Bring down any number the prime does not divide, and repeat until no prime goes into two numbers.
- Write 12 and 18 side by side. Divide both by 2: you get 6 and 9.
- Divide both by 3: you get 2 and 3. No prime goes into both 2 and 3, so stop.
- The GCF is the product of the divisors on the left: 2 × 3 = 6.
- The LCM is the divisors times the numbers left at the bottom: 2 × 3 × 2 × 3 = 36.
For 12, 18 and 30, the divisors 2 and 3 go into all three numbers, leaving 2, 3 and 5. The GCF is 2 × 3 = 6 and the LCM is 2 × 3 × 2 × 3 × 5 = 180, the same as the calculator.
GCF and LCM reference tables
These tables were computed with the same method as the LCM calculator and the GCF calculator. Use them for quick lookups, or to check your own answers against a common pair.
| Pair | GCF | LCM | GCF × LCM = a × b |
|---|---|---|---|
| 4 and 6 | 2 | 12 | 2 × 12 = 24 |
| 6 and 8 | 2 | 24 | 2 × 24 = 48 |
| 8 and 12 | 4 | 24 | 4 × 24 = 96 |
| 9 and 12 | 3 | 36 | 3 × 36 = 108 |
| 10 and 15 | 5 | 30 | 5 × 30 = 150 |
| 12 and 16 | 4 | 48 | 4 × 48 = 192 |
| 12 and 18 | 6 | 36 | 6 × 36 = 216 |
| 15 and 20 | 5 | 60 | 5 × 60 = 300 |
| 16 and 24 | 8 | 48 | 8 × 48 = 384 |
| 18 and 24 | 6 | 72 | 6 × 72 = 432 |
| 24 and 36 | 12 | 72 | 12 × 72 = 864 |
| 30 and 45 | 15 | 90 | 15 × 90 = 1,350 |
| 36 and 48 | 12 | 144 | 12 × 144 = 1,728 |
| 48 and 60 | 12 | 240 | 12 × 240 = 2,880 |
| 75 and 100 | 25 | 300 | 25 × 300 = 7,500 |
LCM of two numbers from 2 to 10
Find the row for one number and the column for the other. The LCM of 8 and 10 is 40, and the LCM of 7 and 9 is 63. It is also the lowest common denominator table for adding fractions with small denominators.
| LCM | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|
| 2 | 2 | 6 | 4 | 10 | 6 | 14 | 8 | 18 | 10 |
| 3 | 6 | 3 | 12 | 15 | 6 | 21 | 24 | 9 | 30 |
| 4 | 4 | 12 | 4 | 20 | 12 | 28 | 8 | 36 | 20 |
| 5 | 10 | 15 | 20 | 5 | 30 | 35 | 40 | 45 | 10 |
| 6 | 6 | 6 | 12 | 30 | 6 | 42 | 24 | 18 | 30 |
| 7 | 14 | 21 | 28 | 35 | 42 | 7 | 56 | 63 | 70 |
| 8 | 8 | 24 | 8 | 40 | 24 | 56 | 8 | 72 | 40 |
| 9 | 18 | 9 | 36 | 45 | 18 | 63 | 72 | 9 | 90 |
| 10 | 10 | 30 | 20 | 10 | 30 | 70 | 40 | 90 | 10 |
LCM and GCF word problems
A short test tells you which one a word problem needs. If you are splitting things into the largest equal groups, find the GCF. If you are waiting for events to line up, or need the smallest amount that different group sizes can share evenly, find the LCM. LCM and GCF word problems are mostly a matter of spotting the clue.
| Clue in the problem | Use | Example |
|---|---|---|
| largest equal groups, biggest piece, most bags | GCF | 48 red and 60 blue counters: GCF 12 means 12 bags |
| smallest amount, together again, same time | LCM | Lights flashing every 6 and 15 seconds: LCM 30 seconds |
| simplify a fraction | GCF | 24/36 ÷ 12 = 2/3 |
| add or subtract fractions | LCM of the denominators | 5/6 + 3/8: LCM 24 |
| pack sizes with nothing left over | LCM | Packs of 10 and 8: buy 40 of each item |
- Hot dogs come in packs of 10 and buns in packs of 8. What is the smallest number of each you can buy with none left over? The LCM of 10 and 8 is 40, so buy 4 packs of hot dogs and 5 packs of buns.
- A teacher has 48 red and 60 blue counters and wants identical bags with none left over. The GCF of 48 and 60 is 12, so she can make 12 bags, each with 4 red and 5 blue counters.
- One bus comes every 12 minutes and another every 18. They arrive together every 36 minutes, the LCM of 12 and 18.
- A 24 by 36 inch floor is tiled with the largest square tile that fits exactly. The GCF is 12, so the tiles are 12 by 12 inches: 2 × 3 = 6 tiles.
LCM calculator for adding and simplifying fractions
When fractions have different denominators, the lowest common denominator is the least common multiple of the denominators. For 5/6 + 3/8, the LCM of 6 and 8 is 24, so 5/6 = 20/24 and 3/8 = 9/24, and the sum is 29/24 = 1 5/24. A bigger common denominator such as 48 also works, but the LCM keeps the numbers small.
To simplify, use the GCF instead: 18/42 has GCF 6, so it simplifies to 3/7. Finish the sum with the fraction calculator or reduce a single fraction with the simplify fractions calculator.
GCF and LCM with variables
In algebra the same ideas apply to terms with variables. For the GCF, take the GCF of the coefficients and the lowest power of each variable. For the LCM, take the LCM of the coefficients and the highest power of each variable. This GCF calculator works with whole numbers, so find the coefficient part here and add the letters by hand.
| Terms | GCF | LCM |
|---|---|---|
| 12x² and 18x | 6x | 36x² |
| 8a³b and 20ab² | 4ab | 40a³b² |
| 15m and 25n | 5 | 75mn |
GCF, GCD and HCF: names and where they are taught
Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) all mean the same number. US classrooms usually say GCF, the United Kingdom, Australia, New Zealand and India usually say HCF, and university texts and computer science say GCD. Wikipedia lists all three names for the greatest common divisor.
In the United States, Common Core grade 6 has students find the GCF of two whole numbers up to 100 and the LCM of two whole numbers up to 12 (standard 6.NS.B.4). In England, the Year 6 national curriculum asks pupils to identify common factors, common multiples and prime numbers. Both topics lead directly into fractions work in the same years.
Questions people ask about the LCM and GCF
What is the LCM of 12 and 18?
The LCM of 12 and 18 is 36. Their prime factors are 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36. Their GCF is 6, and 6 × 36 = 216 = 12 × 18.
What is the GCF of 24 and 36?
The GCF of 24 and 36 is 12. The two numbers share the prime factors 2 × 2 × 3 = 12. Euclid’s method agrees: 36 ÷ 24 leaves 12, and 24 ÷ 12 leaves 0.
How do you find the LCM of three numbers?
Factor each number into primes and keep every prime at its highest power. For 4, 6 and 10 that is 2² × 3 × 5 = 60. You can also take the LCM of two numbers and then the LCM of that answer with the third.
What is the LCM of two prime numbers?
The LCM of two different primes is their product, because they share no factors and the GCF is 1. The LCM of 7 and 11 is 77, and the LCM of 13 and 17 is 221.
Common mistakes with the GCF and LCM
- Mixing them up: the GCF is never bigger than the smallest number, and the LCM is never smaller than the biggest.
- Multiplying the numbers and stopping: a × b is a common multiple, not the least one, unless the GCF is 1.
- Using every prime instead of the right power: the GCF takes the lowest power of shared primes; the LCM takes the highest power of all primes.
- Forgetting that 1 is a factor: if no other number is shared, the GCF is 1.
LCM calculator: frequently asked questions
What is the difference between GCF and LCM?
The GCF is the largest number that divides all the numbers, so it is a factor of each. The LCM is the smallest number all the numbers divide into, so it is a multiple of each. The GCF is never above the smallest number; the LCM is never below the largest.
Can the LCM calculator handle three or more numbers?
Yes. Type up to 12 whole numbers separated by commas or spaces, and the GCF and LCM calculator gives the GCF and LCM of the whole list, with prime factors for every number.
What if the GCF is 1?
Then the numbers are relatively prime, or coprime, and their LCM is simply their product. For 8 and 15 the GCF is 1 and the LCM is 120.
Is GCF the same as GCD and HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
Can I enter zero or negative numbers?
No. Use whole numbers greater than zero. The GCF and LCM of negative numbers are normally found from their absolute values.
How big can the numbers be?
Each number can have up to 15 digits. The LCM can be much larger and is calculated exactly, so you can use big numbers without rounding.
How do I find the LCM from the GCF?
For two numbers, divide their product by the GCF: LCM = a × b ÷ GCF. For 24 and 36, 864 ÷ 12 = 72. This shortcut works only for two numbers at a time.
Does the LCM calculator work offline?
The calculation runs in your browser, so nothing is uploaded. Once the page has loaded, new answers appear instantly as you type.
Related calculators
- Prime factorization calculator: prime factors, all factors and a prime test.
- Fraction calculator: uses the LCM to add and subtract fractions.
- Simplify fractions calculator: reduces a fraction with the GCF.
- Long division calculator: quotients, remainders and decimals with steps.
- Ratio calculator: simplify a ratio by dividing by the GCF.
- GCF and LCM worksheets for printed practice, and the multiplication chart for checking multiples.
Sources and further reading
- Least common multiple on Wikipedia: methods, formulas and the link to the GCD.
- Greatest common divisor on Wikipedia: names, algorithms and properties.
- Common Core State Standards, Grade 6 The Number System: standard 6.NS.B.4.
Last updated: October 2026.