Free Algebra Solver
LCM calculator

LCM Calculator

Enter two to eight whole numbers separated by commas. The LCM calculator shows the prime factors, the LCM, and the GCF.

Preview 12, 18, 30 (LCM & GCF) Ready
Examples
Solution

Worked example: 12, 18, 30

Worked example. Edit the problem above and press LCM & GCF to solve your own.

Problem12, 18, 30
  1. Identify the positive integers

    LCM compares multiples of each entered positive integer.

    Number 1 = 12
    Positive integer
    Number 2 = 18
    Positive integer
    Number 3 = 30
    Positive integer

    Using the exact integer list prevents a decimal or sign from changing the problem class.

  2. Write each number as prime factors

    Break every number into its unique product of prime powers.

    12 = 2^2 × 3
    Prime factorization
    18 = 2 × 3^2
    Prime factorization
    30 = 2 × 3 × 5
    Prime factorization

    The LCM must contain every prime power needed to rebuild every input.

  3. Take the greatest exponent of each prime

    For each prime, keep the largest exponent appearing in any factorization.

    2^2
    Highest required power of 2
    3^2
    Highest required power of 3
    5
    Highest required power of 5

    A smaller exponent would fail to divide at least one input; any extra factor would produce a common multiple that is not least.

  4. Multiply and verify the common multiple

    Multiply the selected prime powers, then divide the result by every original number.

    LCM = 2^2 × 3^2 × 5 = 180
    Multiply the maximum prime powers
    180 ÷ 12 = 15
    LCM is divisible by the input
    180 ÷ 18 = 10
    LCM is divisible by the input
    180 ÷ 30 = 6
    LCM is divisible by the input

    Whole-number quotients prove the result is common to every input, and the maximum-exponent construction proves it is the least such positive number.

  5. Find the GCD from the shared prime powers

    Keep only primes found in every input, using the smallest exponent shared by all of them.

    2
    Smallest exponent of 2 shared by every input
    3
    Smallest exponent of 3 shared by every input
    GCD = 2 × 3 = 6
    Multiply the shared minimum prime powers
    12 ÷ 6 = 2
    Input is divisible by the GCD
    18 ÷ 6 = 3
    Input is divisible by the GCD
    30 ÷ 6 = 5
    Input is divisible by the GCD

    The resulting product divides every input. No larger common divisor can contain another prime power without exceeding at least one input factorization.

AnswerLCM = 180; GCF = 6

Least common multiple

How the LCM calculator finds the least common multiple

This LCM calculator finds the least common multiple of 2 to 8 whole numbers and shows the prime factorization behind the answer. Type the numbers separated by commas, such as 12, 18, 30.

What is the least common multiple?

The least common multiple (LCM) is the smallest positive number that every number in a list divides into evenly. To find it, write each number as a product of primes, then multiply each prime at its highest power. For 12, 18 and 30 the LCM is 2² × 3² × 5 = 180.

How do you find the LCM of two or more numbers?

You find the LCM by taking every prime that shows up in any of the numbers and using its highest power. Multiply those prime powers together and you have the answer.

This is the method the calculator uses, because it works the same way for two numbers or eight. Here is how to find LCM for 12, 18 and 30 by hand.

  1. Factor each number: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5.
  2. List every prime that appears anywhere: 2, 3 and 5.
  3. Pick the highest power of each: 2², 3² and 5.
  4. Multiply: 4 × 9 × 5 = 180.

Check it by dividing: 180 ÷ 12 = 15, 180 ÷ 18 = 10 and 180 ÷ 30 = 6. All three come out whole, so 180 is a common multiple, and the prime method guarantees it's the smallest one.

Can you find the lowest common multiple by listing multiples?

Yes. List the multiples of each number until the same value appears in every list. The first shared value is the lowest common multiple.

For 4 and 6, the multiples of 4 are 4, 8, 12, 16 and the multiples of 6 are 6, 12, 18. The first match is 12, so the LCM is 12. This is fast for small numbers and gets slow quickly for bigger ones like 12, 18 and 30, where you'd have to list fifteen multiples of 12 before reaching 180.

MethodBest forDrawback
Listing multiplesTwo small numbersLong lists for larger numbers
Prime factorizationAny size, three or more numbersYou need to factor each number first
LCM = product ÷ GCFExactly two numbersDoesn't work directly for three or more

How are the LCM and GCF related?

For two numbers, the LCM times the GCF equals the product of the two numbers. So you can get the LCM by dividing the product by the GCF.

Take 12 and 18. Their GCF is 6, and 12 × 18 = 216. Dividing gives 216 ÷ 6 = 36, which is the LCM.

Two-number rule
LCM(a, b) × GCF(a, b) = a × b
Example
36 × 6 = 12 × 18 = 216

The rule breaks for three numbers. For 12, 18 and 30 the GCF is 6 and the LCM is 180, but 180 × 6 = 1,080 while 12 × 18 × 30 = 6,480. That's why the calculator shows the GCF next to the LCM but computes the LCM from prime factors.

How do you use the LCM to find the least common denominator?

The least common denominator of two fractions is the LCM of their denominators. That means you can use this page as an LCD calculator: enter only the denominators.

To add 5/12 + 7/18, find the LCM of 12 and 18, which is 36. Rewrite 5/12 as 15/36 and 7/18 as 14/36. Then add the numerators to get 29/36.

You could also use 12 × 18 = 216 as the denominator, but then you'd have to reduce the answer at the end. The LCD keeps the numbers small. The fraction calculator does this whole process for you if you want to check the arithmetic.

When do you use the LCM in word problems?

Use the LCM when a question asks when two repeating things will happen together again. Buses, schedules, blinking lights and packages that come in different sizes are the usual setups.

Suppose one bus leaves a stop every 12 minutes and another every 18 minutes. They both leave at 8:00. The LCM of 12 and 18 is 36, so they leave together again at 8:36.

Packaging problems work the same way. Hot dogs come 10 to a pack and buns come 8 to a pack. The LCM of 8 and 10 is 40, so the smallest equal amount is 40 of each: 4 packs of hot dogs and 5 packs of buns.

What mistakes do people make when finding the LCM?

The most common mistake is mixing up the LCM and the GCF. The LCM is at least as big as the largest number in your list, and the GCF is at most as big as the smallest. If your LCM of 12 and 18 comes out as 6, you found the GCF.

Another slip is using the lowest power of each prime instead of the highest. For 12 = 2² × 3 and 18 = 2 × 3², taking 2 × 3 gives 6 again. You need 2² × 3² = 36.

People also multiply all the numbers and stop. The product is always a common multiple, but it's often far from the least one. For 12 and 18 the product is 216, six times the real LCM.

What is the LCM of numbers with no common factors?

If two numbers share no factor other than 1, their LCM is just their product. For example, the LCM of 7 and 9 is 63.

This follows from the two-number rule: when the GCF is 1, LCM = a × b ÷ 1. It's a quick check you can do in your head before reaching for the calculator.

Frequently asked questions

Short answers to the questions people ask most about this topic.

What is the LCM of 12, 18 and 30?

The LCM of 12, 18 and 30 is 180. Their prime factorizations are 2² × 3, 2 × 3² and 2 × 3 × 5, and the highest powers multiply to 4 × 9 × 5 = 180.

Is LCM the same as least common denominator?

They're closely linked. The least common denominator of a set of fractions is the LCM of their denominators. You find it with the same steps and then use it as the new denominator.

Can the LCM be one of the numbers?

Yes. If one number is a multiple of all the others, it's the LCM. The LCM of 6 and 12 is 12, because 12 is already a multiple of 6.

How many numbers can I enter in the least common multiple calculator?

You can enter 2 to 8 whole numbers separated by commas. The calculator factors each one, picks the highest prime powers and shows the GCF as well.

Is the lowest common multiple the same as the least common multiple?

Yes. Lowest common multiple and least common multiple are two names for the same thing. Both are shortened to LCM.

Why does LCM times GCF only equal the product for two numbers?

With two numbers, every prime's lower power goes into the GCF and its higher power into the LCM, so together they use each power exactly once. With three or more numbers, the middle powers get left out, so the products don't match.

Math keypad

LCM & GCF mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
a/b key
Select part of the problem first to wrap it in a fraction, root, power, or bars
sin(30)
Scientific functions work in Calculate mode; angles are in degrees unless you use π
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression