Skip to content

LCM Calculator

Find the LCM of any integers, with steps and the GCF

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Type two or more whole numbers into the box, separated by commas, spaces, or new lines — for example 4, 6, 8.
  2. 2.The least common multiple (LCM) appears instantly at the top, with the greatest common factor (GCF/GCD) shown alongside — no button to press.
  3. 3.Read the worked steps and the list of first common multiples to see how the LCM was folded pairwise using lcm(a, b) = |a × b| ÷ gcd(a, b).

About LCM Calculator

The least common multiple (LCM), also called the lowest or smallest common multiple, of a set of integers is the smallest positive whole number that every one of them divides into evenly. This calculator takes two or more integers — type them separated by commas, spaces, or new lines — and returns the LCM the instant you finish typing, along with the worked steps and the first few common multiples. It also reports the greatest common factor (GCF/GCD) alongside, because the two are computed together. Nothing is sent to a server; every calculation runs in your browser.

The fastest reliable way to compute an LCM uses the identity lcm(a, b) = |a × b| ÷ gcd(a, b), where gcd is the greatest common divisor found with the Euclidean algorithm. This tool divides before it multiplies — |a| ÷ gcd(a, b) × |b| — so the intermediate numbers stay as small as possible and large inputs are less likely to overflow. For example, lcm(4, 6) = (4 × 6) ÷ gcd(4, 6) = 24 ÷ 2 = 12. For three or more numbers the operation is folded pairwise, so lcm(3, 4, 5) = lcm(lcm(3, 4), 5) = lcm(12, 5) = 60, and the answer is the same whatever order you enter the numbers in.

There is a second way to see the LCM that explains why the formula works: prime factorization. Write each number as a product of primes, then take every prime that appears to its highest power across the whole set and multiply those together. For 12 = 2² × 3 and 18 = 2 × 3², the LCM takes 2² and 3², giving 2² × 3² = 36. The common factors counted in the GCF are exactly the overlap that the |a × b| ÷ gcd division removes, which is why multiplying the numbers and then dividing out the GCF lands on the LCM.

The LCM is the workhorse behind adding and subtracting fractions. To add 1/4 and 1/6 you first rewrite both fractions over their least common denominator, which is the LCM of 4 and 6, namely 12: 1/4 = 3/12 and 1/6 = 2/12, so the sum is 5/12. Choosing the least common denominator rather than just multiplying the denominators keeps the arithmetic small and the answer close to lowest terms. This is different from the GCF, which is used to reduce a single fraction, so if your goal is simplifying rather than combining fractions you may want the GCF calculator instead.

Beyond fractions, the LCM answers 'when do repeating cycles line up again'. Two buses that leave every 4 and every 6 minutes depart together again after lcm(4, 6) = 12 minutes; gears, blinking lights, shift rotations, and calendar cycles all synchronize at the LCM of their periods. The calculator accepts negative numbers by working with their absolute values, since multiples are counted as positive quantities, so lcm(−4, 6) = 12. Repeated values are fine and do not change the result, and a single number simply returns itself. If any number is 0 the LCM is reported as undefined, because zero has no positive multiples and therefore no common multiple with the rest. Non-integers such as 1.5 are rejected with a clear message, and very large inputs beyond the safe integer range are flagged so you know the answer may be rounded. Use it for homework, least common denominators, scheduling repeating events, or any time you need an exact lowest-common-multiple answer instead of guesswork.

Frequently asked questions

What is the least common multiple (LCM)?
The least common multiple of a set of integers is the smallest positive whole number that every one of them divides into with no remainder. For 4 and 6 the LCM is 12, because 12 is the first number that is a multiple of both 4 (4, 8, 12) and 6 (6, 12). It is also called the lowest or smallest common multiple.
How do you calculate the LCM of two numbers?
This tool uses lcm(a, b) = |a × b| ÷ gcd(a, b), where the greatest common divisor comes from the Euclidean algorithm. For 4 and 6 that is (4 × 6) ÷ 2 = 12. Dividing before multiplying keeps the numbers small, and for three or more values the LCM is folded pairwise, so lcm(3, 4, 5) = lcm(12, 5) = 60.
What is the difference between the LCM and the GCF?
The least common multiple (LCM) is the smallest number that all of your numbers divide into, while the greatest common factor (GCF, or GCD) is the largest number that divides all of them. For 4 and 6 the LCM is 12 and the GCF is 2. Use the LCM as the least common denominator when adding fractions, and the GCF to reduce a fraction to lowest terms.
How does the LCM help with adding fractions?
The LCM of the denominators is the least common denominator. To add 1/4 and 1/6, take the LCM of 4 and 6, which is 12, then rewrite each fraction over 12: 1/4 = 3/12 and 1/6 = 2/12, so the sum is 5/12. Using the LCM instead of just multiplying the denominators keeps the numbers small and the result close to lowest terms.
What happens with 0, decimals, or negative numbers?
If any number is 0 the LCM is shown as undefined, because zero has no positive multiples and therefore no common multiple with the rest. Decimals such as 1.5 are rejected, since the LCM is only defined for whole numbers. Negative numbers are handled by their absolute value because multiples are counted as positive, so lcm(−4, 6) = 12, and duplicate values do not change the answer.

Calculators guides

View all