Least Common Multiple (LCM) Calculator

Use this calculator to easily calculate the least common multiple (LCM) of a set of numbers.

Share calculator:

Put it on your site!
get code

What is a Least Common Multiple (LCM)?

The least common multiple, also known as lowest common multiple or smallest common multiple of a set of integers (a, b, c...) is the smallest positive integer that is divisible by each number of the set. In the simplest case we have just two numbers, a and b, and we can use the notation LCM(a, b). The LCM is also the "lowest common denominator" (see our LCD calculator) which needs to be found before adding, subtracting, or comparing fractions.

One way to understand the least common multiple is by listing all whole numbers that are multiples of two given numbers, for example 3 and 5:

The multiples of 3 are: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33...
The multiples of 5 are: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50...

As you can see, some of the multiples are common for both numbers, and the one with the lowest value is the least common multiple (LCM). In this case that is 15. Knowing the LCM of any two numbers, we can immediately say if a certain number is divisible by each of them - it is, if it is wholy divsible by the LCM.

The least common multiple has application in engineering, astronomy, game theory, and others. For example, in engineering one might need to use gears to downshift or upshift rotational forces, so estimating the radius and number of teeth required for the second meshing gear can be done using LCM. Similarly, if need to find out when planetary or other cosmic bodies's trajectories will lead them to coincide as viewed from Earth, e.g. as in a solar or lunar eclipse, we can use the LCM.

How to calculate LCM?

The easiest way is, of course, to use our least common multiple calculator above, as it can handle LCM calcualtions for many numbers at once and you can enter them any way you like - separated by commas, spaces, tabs, new lines, etc. However, if you are not allowed to or don't want to use an LCM calculator and need to do the math by yourself, you can use the followig algorithm:

We are given a finite sequence of positive integers X = (x1, x2, ..., xn) and n is larger than 1 (so we have at least two numbers in the sequence). Then, on each step m we increase the least element of the sequence by adding to it the corresponding element from the initial sequence, resulting in a new sequence in which all elements remain the same, but the lowest value has been increased. We stop when all elements in the sequence are equal, as their common value is the LCM of sequence X (LCM(X)).

Example least common multiple calculation

We are given the sequence 2, 3, 5 and we need to find LCM(2,3,5). On step zero we have 2, 3, 5.

Step 1: 4, 3, 5 (4 = 2 + 2)

Step 2: 4, 6, 5 (6 = 3 + 3)

Step 3: 6, 6, 5 (6 = 4 + 2)

Step 4: 6, 6, 10 (10 = 5 + 5)

Step 5: 8, 6, 10 (8 = 6 + 2)

...

Step 24: 26, 27, 25 (27 = 24 + 3)

Step 25: 26, 27, 30 (30 = 25 + 5)

Step 26: 28, 27, 30 (28 = 26 + 2)

Step 27: 28, 30, 30 (30 = 27 + 3)

Step 28: 30, 30, 30 (30 = 28 + 2)

The bolded numbers are those that we changed from the previous step. Thus we find that LCM(2,3,5) = 30, and this is exactly the result our LCM calculator will give you. The algorithm is guaranteed to converge to a solution, if there is one. As you can see, it can take quite a lot of steps even for small numbers like these, so it is best to use a lowest common multiple calculator, when possible.

Cite this calculator & page

If you'd like to cite this online calculator resource and information as provided on the page, you can use the following citation:
Georgiev G.Z., "Least Common Multiple Calculator", [online] Available at: https://www.gigacalculator.com/calculators/lcm-calculator.php URL [Accessed Date: 21 Jan, 2019].