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\):
Calculate the least common multiple (LCM) between multiple integers instantly.
Results are calculated automatically as you enter data.
| Row | Integer Value |
|---|
Enter at least two integers.
▼ See explanations and tips below ▼
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.
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.
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.
To find the LCM of \(6\) and \(8\), list their positive multiples:
The first shared value is \(24\), so:
This method is easy to understand, but it can become slow when the numbers are large.
Prime factorization builds the LCM by including every prime factor needed by any number, using the highest exponent that appears.
For example:
The LCM needs \(2^3\), \(3^2\), and \(5\), because those are the highest powers of each prime that appear in either factorization:
For two nonzero integers, the LCM can be found from the greatest common divisor:
Where:
Dividing before multiplying is helpful because it keeps the intermediate value smaller:
Since \(\gcd(24,90)=6\):
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.
For more than two integers, the LCM can be found by combining numbers pair by pair:
For example:
Then combine that result with \(10\):
So:
Find the LCM of \(9\) and \(12\).
List the multiples:
The first common multiple is \(36\):
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:
The reminders line up every \(42\) days.
Find the LCM of \(-12\) and \(18\).
The calculation uses absolute values:
Since \(\gcd(12,18)=6\):
The result is nonnegative. The negative sign affects the direction of multiples on a number line, but it does not make the LCM negative.
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:
For a list such as \(0, 15, 20\), the pairwise calculation continues from \(0\), so the final result is also \(0\).
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.
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\):
The GCD is a shared divisor. The LCM is a shared multiple.
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:
Then use \(24\) as the least common denominator.
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:
When pasting several numbers, commas should separate values, not format one value.
Blank rows are ignored. They do not count as \(0\). To include zero in the calculation, enter \(0\) explicitly.
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.
Even if one or more inputs are negative, the LCM result is not negative. The calculation uses absolute values.
Use LCM when you need to find the first shared whole-number point where integer patterns meet.
Common uses include:
LCM is especially useful when the smallest shared multiple is easier to work with than a larger common multiple.
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.
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.
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\).
In this calculator, no. Negative inputs are converted to their absolute values for the calculation, so the LCM result is nonnegative.
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\).
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.
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.
--?
The result shows -- when there are fewer than two non-blank valid integers. Enter at least two accepted integer values to calculate an LCM.
Books
Online and Official Sources