CompoundPage

LCM calculator (least common multiple)

Run 12, 18 and 30 through the LCM calculator and the least common multiple is 180: the smallest number all three divide into exactly. Their GCF, for comparison, is 6.

Leave at 0 to use two numbers only.

Which result leads. Both the GCF and the LCM are still calculated.

Least common multiple180

Greatest common factor
6
Least common multiple
180
Numbers
12, 18, 30
Prime factorizations
12 = 2^2 x 3 18 = 2 x 3^2 30 = 2 x 3 x 5
GCF takes the lowest power of each shared prime
2 x 3 = 6
LCM takes the highest power of every prime
2^2 x 3^2 x 5 = 180
Reduced ratio Dividing every number by the GCF of 6 gives the simplest whole-number ratio.
2 : 3 : 5
  • GCF is also called the greatest common divisor, highest common factor, GCD or HCF. They are all the same thing.
  • Two numbers with a GCF of 1 are called coprime or relatively prime. They need not be prime themselves: 8 and 9 are coprime.

How the GCF and LCM Calculator works

The least common multiple (LCM) of a set of whole numbers is the smallest positive number that every one of them divides into exactly. For 12, 18 and 30 it is 180: 180 / 12 = 15, 180 / 18 = 10 and 180 / 30 = 6, and no smaller number manages all three.

Listing multiples finds it for small numbers. Count up in the largest number and stop at the first one the others divide: 30, 60, 90, 120, 150, 180. Sixty fails on 18, ninety fails on 12, a hundred and twenty fails on 18, a hundred and fifty fails on 12, and 180 works. With bigger numbers the list gets long.

Prime factorization builds the LCM directly. 12 = 2^2 x 3, 18 = 2 x 3^2 and 30 = 2 x 3 x 5. Take every prime that appears in any of them, at the highest power it reaches anywhere: 2^2 from 12, 3^2 from 18, and 5 from 30. 4 x 9 x 5 = 180. The GCF is the mirror image (only the primes common to all, at their lowest powers), which here is 2 x 3 = 6.

For two numbers there is a shortcut: the LCM is the product divided by the GCF. 12 and 18 have a GCF of 6, so their LCM is 12 x 18 / 6 = 36. The shortcut does not extend to three numbers, and this is the most common LCM mistake. The product of 12, 18 and 30 is 6,480, and 6,480 / 6 = 1,080. That is a common multiple of all three, but six times larger than the least one. The safe way with three or more is to go a pair at a time: the LCM of 12 and 18 is 36, and the LCM of 36 and 30 is 180.

Multiplying the numbers together always gives a common multiple, just rarely the least. It gives the least only when no two of them share a factor: 8 and 9 have no common factor, so their LCM is 72, their product.

The LCM answers "when do these line up again?" Buses leaving a stop every 12, 18 and 30 minutes all leave together again after 180 minutes, three hours. Hot dogs in packs of 10 and buns in packs of 8 come out even at 40: four packs of one and five of the other. Gears with 12 and 18 teeth return to their starting position after 36 teeth have passed.

The best-known use is adding fractions, where the LCM of the denominators is the least common denominator. The page has a separate setting for that, which shows each fraction rewritten over it.

The LCM is defined for whole numbers. For decimals, scale them to whole numbers first; the page takes whole numbers and ignores a 0 in the optional boxes, since every number divides 0 and the question then has no useful answer.

GCF and LCM Calculator FAQ

What is the LCM of 12, 18 and 30?

180. In primes, 12 = 2^2 x 3, 18 = 2 x 3^2 and 30 = 2 x 3 x 5, and the highest power of each prime is 2^2 x 3^2 x 5 = 180.

How do I find the LCM of two numbers quickly?

Divide their product by their GCF. 12 and 18 have a GCF of 6, so the LCM is 12 x 18 / 6 = 36. This only works for two numbers at a time.

Why doesn't product divided by GCF work for three numbers?

Because the GCF only removes what all three share, not what each pair shares. For 12, 18 and 30, 6,480 / 6 = 1,080, which is a common multiple but not the least. Work in pairs instead: LCM(12, 18) = 36, then LCM(36, 30) = 180.

What is the difference between LCM and GCF?

The LCM is the smallest number all of them divide into, so it is at least as big as the largest. The GCF is the largest number that divides all of them, so it is at most as big as the smallest. For 12, 18 and 30 they are 180 and 6.

More from the GCF and LCM Calculator

Related calculators

Embed this calculator
<div id="compoundpage-gcf-lcm-calculator"></div>
<script src="https://compoundpage.com/embed/gcf-lcm-calculator.js" async></script>

The same calculation as JSON