Free Algebra Solver
LCM calculator

LCM calculator with GCD and steps

Find the least common multiple and greatest common divisor of two to eight positive integers, with every selected prime power explained.

Interpreted as: 12, 18, 30 (LCM & GCD) Ready
Examples
Solution

Step-by-step working

Your solution will appear here

Choose an operation and run it to see exact working, verification, and available visuals.

Least common multiple guide

Find the LCM and GCD with prime factors and exact checks

This LCM calculator finds both the least common multiple (LCM) and greatest common divisor (GCD or GCF) of two to eight positive integers. It shows each prime factorization, uses the greatest required exponents for the LCM, uses the smallest powers shared by every input for the GCD, and verifies both answers with exact division.

What is the least common multiple?

A multiple of a positive integer is the result of multiplying it by a positive whole number. The multiples of 12 begin 12, 24, 36, 48, and 60, while the multiples of 18 begin 18, 36, 54, and 72. Numbers such as 36 and 72 that occur in both lists are common multiples. The smallest positive one is the least common multiple, abbreviated LCM.

An LCM calculator is useful when unlike fractions need a common denominator, repeating schedules must align, or equal package groups must be compared. The result is never chosen merely because it is divisible by one input. It must be divisible by every entered integer, and no smaller positive integer can meet all the same prime-factor requirements.

How to use the LCM calculator with steps

Enter two to eight positive integers separated by commas or spaces, such as 12, 18, 30. You may also type lcm(12, 18). Select Find LCM, then compare the interpreted integer list with your question before reading the factorization steps. The result panel reports the LCM and its companion GCD (also called GCF). Decimals, fractions, zero, and negative values are rejected because this tool follows positive-integer definitions.

  1. Read the entered positive integers in their original order.
  2. Write every integer as a product of prime powers.
  3. List every prime that appears in at least one factorization.
  4. For each prime, select the largest exponent found in any input.
  5. Multiply the selected prime powers to obtain the LCM.
  6. Divide the result by every original integer to verify whole-number quotients.
  7. Keep the smallest exponent of each prime shared by every input, then multiply those powers to obtain the GCD.

Worked example: find the LCM of 12, 18, and 30

Prime factorization gives 12 = 2^2 × 3, 18 = 2 × 3^2, and 30 = 2 × 3 × 5. The primes involved are 2, 3, and 5. The greatest exponent of 2 is 2, the greatest exponent of 3 is 2, and the greatest exponent of 5 is 1.

Using those maximum powers gives LCM = 2^2 × 3^2 × 5 = 4 × 9 × 5 = 180. The powers shared by all three numbers are 2 and 3, so GCD = 2 × 3 = 6. Exact checks give 180 ÷ 12 = 15, 180 ÷ 18 = 10, and 180 ÷ 30 = 6 for the LCM; they also give 12 ÷ 6 = 2, 18 ÷ 6 = 3, and 30 ÷ 6 = 5 for the GCD.

Prime-power method
LCM uses each prime raised to its greatest input exponent
Shared-factor method
GCD uses each shared prime raised to its smallest input exponent
Two-number identity
LCM(a, b) × GCF(a, b) = a × b
Example
LCM(12, 18, 30) = 2^2 × 3^2 × 5 = 180

Listing multiples versus prime factorization

Listing multiples works well for small pairs. Write several multiples of each number and identify the first value appearing in every list. For 4 and 6, the lists 4, 8, 12 and 6, 12 show quickly that the LCM is 12. With three numbers or larger values, however, the lists grow and it becomes easier to overlook a smaller common multiple.

Prime factorization scales more clearly because it records exactly what divisibility requires. A professional least common multiple calculator can therefore show both the arithmetic result and the structural reason: each selected prime power is necessary to cover at least one input. This calculator uses that method consistently, including when one number already divides another.

Where LCM appears in fractions and schedules

When adding 1/12 and 1/18, the least common denominator is LCM(12, 18) = 36. Rewriting the fractions as 3/36 and 2/36 creates equal-sized pieces without using a denominator larger than necessary. This connection makes LCM one of the main foundations of exact fraction arithmetic.

LCM also answers alignment questions. If one event repeats every 12 minutes and another every 18 minutes, both cycles return together after 36 minutes, assuming they begin together. The same reasoning applies to package sizes, maintenance intervals, rotations, and repeating patterns. Always check that the real problem asks for the first shared occurrence rather than the greatest group size, which would require a GCF.

Common LCM mistakes and reliable verification

Do not confuse factors with multiples. A factor divides a number, while a multiple is produced by multiplying it. Another common error is multiplying all inputs immediately. Their product is certainly a common multiple, but repeated prime factors may make it much larger than the least common multiple. Selecting the greatest exponent of each prime removes that duplication.

To check an LCM answer, divide it by every input and require a whole-number quotient. To check the GCD, divide every input by the GCD and again require whole-number quotients. Then inspect the chosen prime powers: the LCM row must use the maximum exponents, while the GCD row can use only the minimum exponents shared by every number. The calculator records both kinds of evidence rather than relying on a guess from a list.

Frequently asked questions

Concise answers about the method, notation, checks, and calculator limits.

What does LCM mean?

LCM means least common multiple: the smallest positive integer that is divisible by every number in the entered set.

How many numbers can the LCM calculator use?

This release accepts between two and eight positive integers in one calculation.

How do I enter numbers?

Separate positive integers with commas, spaces, or semicolons, such as 12, 18, 30. The form lcm(12, 18) also works.

Does the calculator show prime factorization?

Yes. It factors every input, identifies the highest prime powers for the LCM, and identifies the smallest powers shared by every input for the GCD.

Does the LCM calculator also find the GCD or GCF?

Yes. Every successful calculation reports the LCM and the GCD. GCD and GCF are two names for the same greatest shared positive factor.

What is the difference between LCM and GCF?

LCM is the smallest positive number that every input divides. GCF, also called GCD, is the largest positive number that divides every input.

Math keypad

LCM & GCD mode

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

Keyboard tips

Ctrl + Enter
Run the selected operation
^
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