Math · Multiples & common denominators

LCM Calculator

Find the least common multiple of two to ten positive whole numbers. The result shows the GCF formula, the pairwise steps, and a divisibility check, so you can confirm that every input divides the answer.

Numbers to compare

Separate 2–10 positive whole numbers with commas or spaces. Commas separate values, so do not use them as thousands separators. The opening example is 12, 18.

Inputs must be greater than zero and no larger than 9,007,199,254,740,991; each value is calculated exactly.

Calculated in your browser.
Least common multiple

36 LCM

Least common multiple of 12 and 18

Inputs2 numbers12, 18
Largest input18The LCM is at least the largest input.
Product ÷ GCF216 ÷ 6 = 36gcd(12, 18) = 6
Multiple check36 ÷ 12 = 336 ÷ 18 = 2
Method
Use the GCF formulagcd(12, 18) = 6lcm = 12 ÷ 6 × 18 = 36Check: 36 ÷ 12 = 3; 36 ÷ 18 = 2
Each pair is divided by its GCF before multiplying, so the running value stays exact even when the LCM is very large.

The LCM is computed exactly with whole-number arithmetic. With large inputs the result can be much larger than the input limit, so the display may be a long integer.

Find the first number they all divide

How to use the LCM calculator

Enter two to ten positive whole numbers, separated by commas or spaces. The opening example is 12, 18, which returns 36. The smaller example used below, 4 and 6, returns 12 and is a quick way to check the formula by hand.

Results update as you type, the URL keeps the current list, and Reset returns to 12, 18. Commas separate numbers, so do not write 1,200 for one value; type 1200. Line breaks are accepted as separators when you paste a list.

The calculator rejects empty input, a single number, more than ten numbers, decimals, negative values, zero, and values above 9,007,199,254,740,991. The result stays exact even when the LCM is much larger than any input, because the running value is kept as a BigInt rather than a floating-point number.

What the least common multiple means

A multiple of a number is what you get by multiplying it by a whole number. The common multiples of a group are the values that appear in every member's list of multiples. The least common multiple is the smallest positive value in that shared list.

For 4 and 6, the multiples of 4 begin 4, 8, 12, 16, 20, and the multiples of 6 begin 6, 12, 18, 24. The first shared value is 12, so the LCM is 12. The common multiples do not stop there: 24, 36, and every other multiple of 12 are also common multiples, which is why the least one is the useful summary.

Zero is a common multiple of every whole number, but it is not the least positive common multiple. This page works with positive whole numbers, so zero is not accepted as an input. A value of 1 is allowed in the list; the LCM of 1 and n is n.

The GCF formula for LCM

For two positive whole numbers, the LCM is their product divided by their greatest common factor. Dividing by the GCF first keeps the intermediate value smaller and makes the arithmetic easier to check.

Two numberslcm(a, b) = a × b ÷ gcd(a, b)Same formula, divided firstlcm(a, b) = (a ÷ gcd(a, b)) × bMore than two numberslcm(a, b, c) = lcm(lcm(a, b), c)

The product a × b counts every shared prime factor twice. Dividing by the GCF removes one copy of those shared factors, leaving each prime at its highest power. For 4 and 6, gcd(4, 6) = 2, so 4 × 6 ÷ 2 = 12. The direct multiplication 4 × 6 = 24 is also a common multiple, but it is not the least one.

Prime factorization gives the same answer another way. Write 4 = 2² and 6 = 2 × 3, then take the highest power of each prime that appears: 2² × 3 = 12. The GCF method usually needs fewer steps for large inputs, and the calculator uses it with exact integer division.

Worked example: LCM of 4 and 6

The default inputs on this page are 12 and 18, so the opening result is 36. The 4 and 6 example below is the smaller case to check first, and the same two methods agree.

Multiples of 44, 8, 12, 16, 20, …
Multiples of 66, 12, 18, 24, 30, …
First shared multiple12
GCF of 4 and 62
Product ÷ GCF4 × 6 ÷ 2 = 12
Divisibility check12 ÷ 4 = 3; 12 ÷ 6 = 2

For the opening values, gcd(12, 18) = 6, so the LCM is (12 ÷ 6) × 18 = 2 × 18 = 36. Checking the result: 36 ÷ 12 = 3 and 36 ÷ 18 = 2, so both inputs divide 36 exactly and no smaller positive value does.

A three-number example uses the pairwise fold. For 4, 6, and 10, lcm(4, 6) = 12, then lcm(12, 10) = 60. Checking the final value: 60 ÷ 4 = 15, 60 ÷ 6 = 10, and 60 ÷ 10 = 6. The calculator displays this chain for longer lists.

When the LCM is the product: coprime numbers

If two numbers are coprime, their GCF is 1, so the formula leaves the product unchanged. For 8 and 15, gcd(8, 15) = 1 and the LCM is 8 × 15 = 120. Consecutive whole numbers are always coprime, so the LCM of 9 and 10 is 90.

The product is not the LCM when the numbers share a factor. For 4 and 6 the product is 24, but the LCM is 12 because the shared factor 2 is counted twice in the product. A quick check is to compare the product with the result: if they are equal, the pair is coprime.

For three or more numbers, pairwise coprime inputs make the LCM equal to the product. For example, 4, 9, and 25 have no shared factor in any pair, and their LCM is 4 × 9 × 25 = 900. An overall GCF of 1 is not enough on its own: 6, 10, and 15 have no factor common to all three, but their LCM is 30, not the product 900.

Common denominators and repeating cycles

The most common use of the LCM is finding a common denominator. To add 1/4 and 1/6, find the LCM of 4 and 6, which is 12. Rewrite both fractions with 12 as the denominator: 1/4 = 3/12 and 1/6 = 2/12, so the sum is 5/12. Converting to a common denominator does not change either fraction; it only changes how the parts are counted.

The LCM also answers questions about events that repeat at fixed intervals. If one process repeats every 12 minutes and another every 18 minutes, both align again after 36 minutes, because lcm(12, 18) = 36. This assumes both cycles start at the same moment. If their start times differ, add that offset before using the LCM as the next meeting time.

The arithmetic is the same for multiples of days, inches, or units on a scale. The LCM itself has no unit; it takes the unit of the quantities being compared. That is why a common denominator is a count of parts, not a measurement in inches or minutes.

Limits and large results

This calculator accepts 2 to 10 positive whole numbers. Each input may be as large as 9,007,199,254,740,991, the largest integer JavaScript can represent exactly as a number. Inputs are converted to BigInt before calculation, so the result is exact rather than rounded to a floating-point approximation.

The output is not limited to that input range. The LCM of ten large coprime values can have well over a hundred digits, and the calculator prints every digit with grouping. It does not switch to scientific notation, because that would round the answer. A very long result is still the exact LCM, not a display estimate.

Zero is rejected even though the standard convention gives lcm(0, n) = 0. That value describes no positive repeating cycle and cannot be a common denominator, so including it would make the tool's positive-number model inconsistent. Decimals and negative numbers are rejected for the same reason: they are outside the domain this page calculates.

The LCM is always at least the largest input. It equals the largest input when that value is already a multiple of every other input, as with 4 and 12, where the LCM is 12 rather than a larger number.

LCM calculator FAQs

Is the LCM the same as the least common denominator?

The least common denominator is the LCM of the denominators in a particular fraction problem. For 1/4 and 1/6, the denominators are 4 and 6, so the least common denominator is 12. LCM by itself is a property of the numbers and does not imply that a fraction is involved.

What is the LCM of 0 and a number?

By the usual convention, lcm(0, n) = 0 because 0 is a common multiple and no positive multiple of 0 exists. This calculator does not accept zero: it is built for positive whole numbers, and a common denominator or repeating cycle needs a positive value. Remove the 0 and enter a value greater than zero.

Why does dividing by the GCF give the least common multiple?

The product includes every shared prime factor twice. The GCF contains one copy of those shared factors, so dividing it out leaves one copy of each. For 4 and 6, the product 24 contains 2 twice; dividing by gcd(4, 6) = 2 leaves 12, which has each prime at the highest power that appears.

Is the LCM always larger than every input?

No. The LCM is at least the largest input, but it can equal it. If one input divides another, the larger number is already a common multiple: lcm(4, 12) = 12. Equal inputs also return that value, such as lcm(9, 9) = 9.