Skip to content
KazamTools

LCM Calculator (Least Common Multiple and GCF)

The LCM and GCF of any whole numbers, worked out three ways so you can follow every step.

By , Founder and editor-in-chiefUpdated

Two to 20 whole numbers, separated by commas or spaces. Do not use commas inside a number (write 1000, not 1,000).

LCM(12, 18, 30)

180

GCF (HCF) = 6

Least common multiple (LCM)
180
2² × 3² × 5
Greatest common factor (GCF / HCF)
6
2 × 3

Method 1: prime factorization

NumberPrime factorsPower form
122 × 2 × 32² × 3
182 × 3 × 32 × 3²
302 × 3 × 52 × 3 × 5
  1. LCM: take every prime that appears, at its highest power: 2² × 3² × 5 = 180
  2. GCF: take only the primes in every number, at their lowest power: 2 × 3 = 6

Method 2: division (ladder) method

Divide by the smallest prime that goes into at least one number. Bring down any number it does not divide. Repeat until every number is 1.

Divide by121830
2121830
26915
33915
3135
5115
111

LCM = product of the divisors = 2 × 2 × 3 × 3 × 5 = 180

Method 3: Euclid’s algorithm for the GCF

  1. GCF(12, 18):
  2. 18 = 1 × 12 + 6
  3. 12 = 2 × 6 + 0
  4. → GCF = 6
  5. GCF(6, 30), carrying the GCF so far:
  6. 30 = 5 × 6 + 0
  7. → GCF = 6

LCM from the GCF: LCM(a, b) = a × b ÷ GCF(a, b)

  1. LCM(12, 18) = 12 × 18 ÷ GCF(12, 18) = 216 ÷ 6 = 36
  2. LCM(36, 30) = 36 × 30 ÷ GCF(36, 30) = 1,080 ÷ 6 = 180

Adding fractions? The LCM of the denominators is the least common denominator, and the fraction calculator uses it for you. To simplify a ratio with the GCF, try the ratio calculator.

How to use the LCM Calculator

  1. 1Type two or more whole numbers, separated by commas or spaces, for example 12, 18, 30.
  2. 2Read the least common multiple (LCM) and the greatest common factor (GCF, also called HCF).
  3. 3Follow the prime factorization table, the division ladder and Euclid’s algorithm to see how each answer was found.
  4. 4Copy the LCM or GCF with one tap.

LCM and GCF in one sentence each

The least common multiple (LCM) is the smallest positive number that all of your numbers divide into exactly. The greatest common factor (GCF) is the largest number that divides exactly into all of them. The GCF is also called the highest common factor (HCF) or the greatest common divisor (GCD).

For 12 and 18: the LCM is 36 (the smallest number in both times tables) and the GCF is 6 (the biggest number that goes into both).

Three ways to find the LCM

1. List the multiples

Write out the multiples of each number until one appears on every list.

  • Multiples of 4: 4, 8, 12, 16, 20, 24…
  • Multiples of 6: 6, 12, 18, 24…

The first shared multiple is 12, so LCM(4, 6) = 12. This is the method most people learn first. It is quick for small numbers but slow for big ones.

2. Prime factorization

Break each number into primes. The LCM uses every prime that appears, each at its highest power. The GCF uses only the primes that appear in every number, each at its lowest power.

LCM = product of each prime at its highest power · GCF = product of shared primes at their lowest power

Example: 12, 18 and 30.

Number Prime factors Power form
12 2 × 2 × 3 2² × 3
18 2 × 3 × 3 2 × 3²
30 2 × 3 × 5 2 × 3 × 5
  • LCM = 2² × 3² × 5 = 4 × 9 × 5 = 180
  • GCF = 2 × 3 = 6 (5 is not in every number, and the lowest powers of 2 and 3 are both 1)

3. The division (ladder) method

Write the numbers in a row. Divide by a prime that goes into at least one of them, bring down any number it does not divide, and repeat until every number is 1. The LCM is the product of the primes you divided by.

Divide by 12 18 30
2 12 18 30
2 6 9 15
3 3 9 15
3 1 3 5
5 1 1 5
1 1 1

LCM = 2 × 2 × 3 × 3 × 5 = 180. The calculator draws this ladder for your numbers.

Euclid’s algorithm and the LCM formula

For two numbers there is a fast shortcut that needs no factors at all. Euclid’s algorithm finds the GCF by repeated division: divide the larger number by the smaller, keep the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.

Example: GCF(84, 126).

  • 126 = 1 × 84 + 42
  • 84 = 2 × 42 + 0, so the GCF is 42.

Then use the link between the two:

LCM(a, b) = a × b ÷ GCF(a, b)

LCM(84, 126) = 84 × 126 ÷ 42 = 10,584 ÷ 42 = 252.

For three or more numbers, work in pairs: LCM(a, b, c) = LCM(LCM(a, b), c), and the same for the GCF. This is how the calculator handles numbers with up to 60 digits exactly, even when their prime factors are too large to find.

LCM and GCF table

Numbers LCM GCF
2 and 3 6 1
4 and 6 12 2
6 and 8 24 2
8 and 12 24 4
9 and 12 36 3
10 and 15 30 5
12 and 15 60 3
12 and 18 36 6
15 and 20 60 5
3, 4 and 5 60 1
2 to 10 2,520 1

Where you use them

  • Adding fractions. The least common denominator is the LCM of the denominators. To add 5/12 + 7/18, use LCM(12, 18) = 36: 15/36 + 14/36 = 29/36.
  • Things that repeat. One bus leaves every 12 minutes and another every 18 minutes. If both leave at 9:00, they next leave together after LCM(12, 18) = 36 minutes, at 9:36.
  • Sharing into equal groups. You want to cut ribbons of 24 cm and 36 cm into equal pieces, as long as possible, with nothing left over. The longest piece is GCF(24, 36) = 12 cm.
  • Simplifying. Dividing the top and bottom of a fraction, or both sides of a ratio, by their GCF puts it in lowest terms in one step.

Common mistakes

  • Multiplying the numbers together. 4 × 6 = 24 is a common multiple, but not the least one. Multiplying only gives the LCM when the numbers share no factor (their GCF is 1).
  • Mixing up highest and lowest powers. Highest powers of all primes for the LCM; lowest powers of shared primes for the GCF.
  • Using LCM × GCF = product with three numbers. It only holds for two. For 2, 4 and 6 the LCM is 12 and the GCF is 2, so LCM × GCF = 24, but 2 × 4 × 6 = 48.
  • Including 0. Every number divides 0, so 0 has no least common multiple with other numbers. Leave it out.

Working with fractions? The fraction calculator finds the common denominator for you. To simplify a ratio such as 12:18, use the ratio calculator, and for division with remainders step by step, try the long division calculator. Everything is calculated in your browser and nothing is uploaded.

Cite this calculator

Using this calculator in an essay, report or article? Copy a ready-made reference. Check your teacher's or publisher's style guide for small differences.

APA
KazamTools. (2026, November 3). LCM calculator. Retrieved November 20, 2026, from https://kazamtools.com/math/lcm-calculator/
MLA
"LCM Calculator." KazamTools, 3 Nov. 2026, https://kazamtools.com/math/lcm-calculator/. Accessed 20 Nov. 2026.
Chicago
KazamTools. "LCM Calculator." Last modified November 3, 2026. Accessed November 20, 2026. https://kazamtools.com/math/lcm-calculator/.
Plain link
LCM Calculator (KazamTools): https://kazamtools.com/math/lcm-calculator/
HTML link
<a href="https://kazamtools.com/math/lcm-calculator/">LCM calculator</a> by KazamTools

Frequently asked questions

What is the least common multiple?

The LCM is the smallest positive number that every one of your numbers divides into exactly. The LCM of 4 and 6 is 12, because 12 is the first number on both lists of multiples.

How do you find the LCM using prime factorization?

Write each number as a product of primes, then multiply every prime that appears, each at its highest power. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.

What is the difference between the LCM and the GCF?

The GCF (greatest common factor) is the largest number that divides into all of your numbers; the LCM is the smallest number they all divide into. For 12 and 18 the GCF is 6 and the LCM is 36.

Is HCF the same as GCF?

Yes. HCF (highest common factor), GCF (greatest common factor) and GCD (greatest common divisor) are three names for the same number.

How are the LCM and GCF related?

For two numbers, LCM × GCF = the product of the numbers. For 12 and 18: 36 × 6 = 216 = 12 × 18. So LCM(a, b) = a × b ÷ GCF(a, b). This shortcut does not work for three or more numbers at once.

Can I find the LCM of very large numbers?

Yes. The calculator uses exact whole-number arithmetic for numbers up to 60 digits, so the answer is never rounded. For huge numbers with large prime factors it skips the factor tables but still shows Euclid’s steps.

Guides

Was this tool helpful?

Add this lcm calculator to your website (free)

Copy this code into any web page. The tool stays free, has no ads inside it, and works on phones. Please keep the credit link under it.

Want a live preview or light and dark colours? Open this widget in the widget builder, where you can also browse every free calculator widget.