LCM Calculator

Find the least common multiple of two or three numbers using the gcd formula, with the first multiples listed for verification.

LCM Calculator — input your values

Leave at 0 to use just two numbers.

What does this math calculator do?

The LCM calculator finds the least common multiple of two or three whole numbers — the smallest number that all of them divide into evenly. It computes the answer with the formula lcm(a, b) = a × b ÷ gcd(a, b), which is exact and fast even for large numbers.

The first multiples of each number are listed in a table so you can see the least common multiple appearing in every column, and the gcd steps are shown in full. This makes the tool ideal for adding and subtracting fractions, where you need a common denominator.

Formula and variables

lcm(a, b) = |a × b| ÷ gcd(a, b) · gcd via the Euclidean algorithm

The formula works for any pair of whole numbers. For three numbers, chain the operation: lcm(a, b, c) = lcm(lcm(a, b), c).

SymbolMeaning
a, bThe numbers
gcdGreatest common divisor
lcmLeast common multiple

Worked example

Two buses leave the station every 4 minutes and every 6 minutes. When will they next leave together?

  1. Find the gcd of 4 and 6: gcd(4, 6) = 2.
  2. Apply the formula: lcm = 4 × 6 ÷ 2 = 12.
  3. Multiples of 4: 4, 8, 12; multiples of 6: 6, 12 — the first common multiple is 12.

Answer: The buses leave together every 12 minutes.

Tips and common mistakes

Tips

  • Use the LCM as the common denominator when adding or subtracting fractions — it keeps the numbers as small as possible.
  • When one number divides another evenly, the larger number is the LCM (for example lcm(3, 12) = 12).
  • For two numbers that share no common factors, the LCM is simply their product.
  • To find the LCM of several numbers, keep chaining: lcm(a, b, c) = lcm(lcm(a, b), c).

Common mistakes to avoid

  • Choosing any common multiple instead of the least one — 24 and 36 are common multiples of 4 and 6, but 12 is the LCM.
  • Forgetting to divide by the gcd in the formula, which gives the product rather than the LCM.
  • Entering decimals — the LCM is defined for whole numbers only.

LCM Calculator — frequently asked questions

What is the difference between LCM and GCF?

The LCM is the smallest number that both numbers divide into (a multiple), while the GCF is the largest number that divides both (a factor). For 4 and 6, the LCM is 12 and the GCF is 2.

How is the LCM used with fractions?

It is the smallest common denominator. To add 1/4 and 1/6 you convert to twelfths: 3/12 + 2/12 = 5/12.

What is the LCM of two numbers with no common factors?

Their product. For example, lcm(5, 7) = 35.

Why does the lcm formula use the gcd?

Because a × b counts the shared factors twice. Dividing by the gcd removes the duplication, leaving the smallest common multiple.

Can the LCM be smaller than both numbers?

No. The LCM is a multiple of each number, so it is always at least as large as the bigger one.

Is the LCM of 0 defined?

No. Every number divides 0, so no least common multiple exists — this calculator asks for non-zero values.