Least Common Multiple Calculator

Calculate the least common multiple (LCM) between multiple integers instantly.

Results are calculated automatically as you enter data.

Data inputs
Row Integer Value
Least Common Multiple 0

Enter at least two integers.

▼ See explanations and tips below ▼

What Is the Least Common Multiple?

The least common multiple, usually shortened to LCM, is the smallest positive number that is a multiple of each number in a set.

A multiple of a number is what you get when you multiply that number by an integer. For example, the positive multiples of \(6\) include \(6, 12, 18, 24, 30, \ldots\). The positive multiples of \(8\) include \(8, 16, 24, 32, \ldots\). The smallest number that appears in both lists is \(24\), so the least common multiple of \(6\) and \(8\) is \(24\).

LCM answers a simple question: what is the first whole-number value that two or more integer patterns have in common? That makes it useful in arithmetic, fractions, scheduling, repeating cycles, and any situation where several integer intervals need to line up.

For positive integers, the LCM is normally described as the smallest positive common multiple. When negative integers are involved, the sign is usually ignored because multiples line up by size. For example, \(-6\) and \(6\) lead to the same LCM with \(8\), because the calculation uses absolute values.


Why the Least Common Multiple Matters

LCM is one of the basic tools for working with whole numbers. It helps you combine quantities that repeat at different rates.

Students often use LCM when adding or subtracting fractions with different denominators. If the denominators are \(6\) and \(8\), the least common denominator is \(24\), because \(24\) is the least common multiple of \(6\) and \(8\).

LCM also appears in real-world timing problems. If one event repeats every \(4\) days and another repeats every \(10\) days, the LCM tells you when they will happen together again. Since \(\operatorname{lcm}(4,10)=20\), the two events line up every \(20\) days.

Using the least common multiple instead of just any common multiple keeps numbers smaller and calculations easier.


Key Terms to Know

  • Integer: A whole number that may be positive, negative, or zero, such as \(-7\), \(0\), or \(42\).
  • Multiple: A number produced by multiplying another number by an integer. For example, \(35\) is a multiple of \(5\) because \(5 \times 7 = 35\).
  • Common multiple: A number that is a multiple of every number in a given set. For example, \(60\) is a common multiple of \(12\) and \(15\).
  • Least common multiple: The smallest positive common multiple for a set of positive integers.
  • Greatest common divisor: The largest integer that divides all the numbers in a set without a remainder. It is often abbreviated as GCD.
  • Prime factorization: A way of writing a whole number as a product of prime numbers.
  • Euclidean algorithm: An efficient method for finding the greatest common divisor by repeated division and remainders.
  • Least common denominator: The LCM of two or more denominators, used when comparing, adding, or subtracting fractions.

How the Least Common Multiple Works

There are several ways to find an LCM. The easiest method for small numbers is to list multiples until you find the first match. For larger numbers, prime factorization or the GCD relationship is usually more efficient.

Listing multiples

To find the LCM of \(6\) and \(8\), list their positive multiples:

  • Multiples of \(6\): \(6, 12, 18, 24, 30, \ldots\)
  • Multiples of \(8\): \(8, 16, 24, 32, \ldots\)

The first shared value is \(24\), so:

$$ \operatorname{lcm}(6,8)=24 $$

This method is easy to understand, but it can become slow when the numbers are large.

Using prime factorization

Prime factorization builds the LCM by including every prime factor needed by any number, using the highest exponent that appears.

For example:

$$ 24 = 2^3 \times 3 $$
$$ 90 = 2 \times 3^2 \times 5 $$

The LCM needs \(2^3\), \(3^2\), and \(5\), because those are the highest powers of each prime that appear in either factorization:

$$ \operatorname{lcm}(24,90)=2^3 \times 3^2 \times 5 $$
$$ \operatorname{lcm}(24,90)=8 \times 9 \times 5 = 360 $$

Using the GCD relationship

For two nonzero integers, the LCM can be found from the greatest common divisor:

$$ \operatorname{lcm}(a,b)=\frac{|a|}{\gcd(|a|,|b|)} \times |b| $$

Where:

  • \(|a|\) means the absolute value of \(a\).
  • \(|b|\) means the absolute value of \(b\).
  • \(\gcd(|a|,|b|)\) is the greatest common divisor of the two absolute values.

Dividing before multiplying is helpful because it keeps the intermediate value smaller:

$$ \operatorname{lcm}(24,90)=\frac{24}{\gcd(24,90)} \times 90 $$

Since \(\gcd(24,90)=6\):

$$ \operatorname{lcm}(24,90)=\frac{24}{6} \times 90 = 4 \times 90 = 360 $$

The greatest common divisor can be found efficiently with the Euclidean algorithm. If \(a = bq + r\), then the GCD of \(a\) and \(b\) is the same as the GCD of \(b\) and \(r\). Repeating this process eventually reaches a remainder of zero, and the last nonzero remainder is the GCD.

More than two numbers

For more than two integers, the LCM can be found by combining numbers pair by pair:

$$ \operatorname{lcm}(a,b,c)=\operatorname{lcm}(\operatorname{lcm}(a,b),c) $$

For example:

$$ \operatorname{lcm}(6,8)=24 $$

Then combine that result with \(10\):

$$ \operatorname{lcm}(24,10)=120 $$

So:

$$ \operatorname{lcm}(6,8,10)=120 $$

Examples of Least Common Multiple in Practice

Example 1: A simple LCM

Find the LCM of \(9\) and \(12\).

List the multiples:

  • Multiples of \(9\): \(9, 18, 27, 36, 45, \ldots\)
  • Multiples of \(12\): \(12, 24, 36, 48, \ldots\)

The first common multiple is \(36\):

$$ \operatorname{lcm}(9,12)=36 $$

Example 2: A scheduling situation

Suppose one reminder repeats every \(6\) days and another repeats every \(14\) days. To find when both reminders happen on the same day again, find the LCM of \(6\) and \(14\).

Use the GCD relationship:

$$ \gcd(6,14)=2 $$
$$ \operatorname{lcm}(6,14)=\frac{6}{2} \times 14 = 3 \times 14 = 42 $$

The reminders line up every \(42\) days.


Example 3: Negative numbers

Find the LCM of \(-12\) and \(18\).

The calculation uses absolute values:

$$ |-12|=12 $$
$$ |18|=18 $$

Since \(\gcd(12,18)=6\):

$$ \operatorname{lcm}(-12,18)=\frac{12}{6} \times 18 = 36 $$

The result is nonnegative. The negative sign affects the direction of multiples on a number line, but it does not make the LCM negative.


Example 4: A zero input

Many elementary explanations define LCM only for positive integers. This calculator also accepts zero and uses a common programming convention: if a pairwise LCM calculation includes zero, that pairwise result is \(0\).

For example:

$$ \operatorname{lcm}(0,15)=0 $$

For a list such as \(0, 15, 20\), the pairwise calculation continues from \(0\), so the final result is also \(0\).


How to Interpret the Result

For positive integers, the result is the smallest positive whole number that all entered values divide evenly.

If the result is small, the numbers line up quickly. For example, \(\operatorname{lcm}(4,6)=12\), so the two patterns meet after only \(12\) units.

If the result is large, the numbers do not line up until a later multiple. For example, \(\operatorname{lcm}(35,64)=2240\), so the shared cycle is much longer.

When negative numbers are entered, the result is still nonnegative because the calculation is based on absolute values.

A result of \(0\) means zero was included in a way that makes the pairwise LCM convention return zero. This is different from the usual classroom definition that focuses on positive integers only, so treat zero results as a special case.

If the result shows --, there are not yet at least two non-blank valid integers to calculate. If the result shows Invalid input, at least one non-blank entry is not in an accepted integer format.

The result is an exact integer result. No decimal rounding is applied, and the output is not shortened into scientific notation.


Common Mistakes and Misconceptions

Confusing LCM with GCD

LCM and GCD move in opposite directions. The GCD is the greatest number that divides the inputs. The LCM is the least number that the inputs divide into.

For \(12\) and \(18\):

$$ \gcd(12,18)=6 $$
$$ \operatorname{lcm}(12,18)=36 $$

The GCD is a shared divisor. The LCM is a shared multiple.

Entering decimals or fractions

LCM is an integer concept in this calculator. Inputs such as \(2.5\), \(1/2\), or \(3\frac{1}{4}\) are not accepted.

If you are working with fractions, you usually want the LCM of the denominators. For example, to add fractions with denominators \(6\) and \(8\), find:

$$ \operatorname{lcm}(6,8)=24 $$

Then use \(24\) as the least common denominator.

Using commas as thousands separators

A value such as \(1,000\) can be misread as two separate values or rejected, depending on where it is entered. Use plain digits instead:

$$ 1000 $$

When pasting several numbers, commas should separate values, not format one value.

Expecting blank rows to count as zero

Blank rows are ignored. They do not count as \(0\). To include zero in the calculation, enter \(0\) explicitly.

Entering only one number

LCM compares at least two integer values. With only one non-blank value, there is no pair of numbers to compare, so the calculator cannot produce a meaningful LCM result.

Expecting a negative LCM

Even if one or more inputs are negative, the LCM result is not negative. The calculation uses absolute values.


When to Use the Least Common Multiple

Use LCM when you need to find the first shared whole-number point where integer patterns meet.

Common uses include:

  • Finding a least common denominator for fractions.
  • Comparing repeating schedules or cycles.
  • Solving divisibility problems.
  • Working with ratios that need a shared whole-number scale.
  • Planning repeated tasks that happen at different intervals.
  • Checking when several integer-based events align.

LCM is especially useful when the smallest shared multiple is easier to work with than a larger common multiple.


Limitations and Things to Keep in Mind

The LCM is designed for integer arithmetic. It does not directly apply to decimals, fractions, mixed numbers, units of measurement, or scientific notation unless those values are first converted into an appropriate integer form.

For positive integers, the usual LCM is the smallest positive common multiple. Zero is a special case. This calculator accepts zero and returns \(0\) when zero participates in the pairwise LCM calculation, but many classroom definitions avoid zero by defining LCM only for positive integers.

Very large integers can produce very large LCM results. The calculator is designed to work with exact integer arithmetic, but extremely large inputs may still be limited by browser memory or performance.

The result is exact for valid integer inputs that can be processed, but the calculator does not show intermediate steps such as prime factorization, GCD remainders, or multiple lists. If you need to show your work for a class assignment, use the result as a check and write out the required method separately.


How to Use This Calculator

  1. Enter an integer in each of the first two rows.
  2. Add more rows if you want the LCM of three or more integers.
  3. Leave unused rows blank; blank rows are ignored.
  4. Use the import option to paste a list of integers separated by spaces, commas, or semicolons.
  5. Do not use decimals, fractions, scientific notation, or thousands separators inside a number.
  6. Review the LCM result and the status message.
  7. Correct any value marked as invalid before relying on the result.

Frequently Asked Questions

What is the least common multiple in simple terms?

The least common multiple is the smallest positive number that two or more numbers divide evenly into. For example, \(24\) is the LCM of \(6\) and \(8\) because both \(6\) and \(8\) divide \(24\), and no smaller positive number works.


What is the difference between LCM and GCD?

The GCD is the largest shared divisor of the numbers. The LCM is the smallest shared multiple of the numbers. For example, the GCD of \(12\) and \(18\) is \(6\), while their LCM is \(36\).


Can the LCM be negative?

In this calculator, no. Negative inputs are converted to their absolute values for the calculation, so the LCM result is nonnegative.


What happens if one of the numbers is zero?

This calculator accepts zero. If zero is included in a pairwise LCM calculation, that pairwise result is \(0\), so a list containing zero can produce a final result of \(0\).


Can I find the LCM of more than two numbers?

Yes. The LCM of several integers can be found by combining the numbers pair by pair. For example, first find the LCM of the first two numbers, then find the LCM of that result with the next number, and continue until all numbers have been included.


Why are decimals and fractions not accepted?

The calculator is meant for integer arithmetic. Decimals and fractions need a different interpretation before an LCM calculation makes sense. If you are working with fractions, you usually use the LCM of the denominators to find a least common denominator.


Why does the result show --?

The result shows -- when there are fewer than two non-blank valid integers. Enter at least two accepted integer values to calculate an LCM.


Sources and References

Books

  1. Lynn Marecek and MaryAnne Anthony-Smith. Prealgebra 2e. OpenStax, 2020. Section 2.5, “Prime Factorization and the Least Common Multiple.” https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple
  2. OpenStax. Contemporary Mathematics. OpenStax, 2023. Section 3.1, “Prime and Composite Numbers,” and Chapter 3 Key Concepts. https://openstax.org/books/contemporary-mathematics/pages/3-1-prime-and-composite-numbers
  3. William Stein. Elementary Number Theory: Primes, Congruences, and Secrets: A Computational Approach. Springer, 2009. Sections 1.1 and 2.3 on greatest common divisors and the Euclidean algorithm. https://www.maths.tcd.ie/pub/Maths/Courseware/NumberTheory/Stein.pdf

Online and Official Sources

  1. ProofWiki. “Product of GCD and LCM.” Last modified September 20, 2022. https://proofwiki.org/wiki/ProductofGCDandLCM