Skip to content
Calculator Collection

LCM Calculator

Find the least common multiple — the smallest positive integer that two numbers both divide into evenly. It is essential for adding fractions, scheduling repeating events, and aligning cycles.

Last updated: May 2026

Fill in the required fields to see your result.

Compare with similar

About this calculator

The least common multiple (LCM) of two integers a and b is the smallest positive integer that is a multiple of both. This calculator computes it from the greatest common divisor using the identity lcm(a, b) = |a × b| / gcd(a, b), where gcd is found by the Euclidean algorithm. Here num1 and num2 are the inputs, taken as magnitudes. Dividing by the GCD before (or after) multiplying prevents double counting the shared factors: a and b together contain the common factors only once in their LCM. Equivalently, if you write each number's prime factorization, the LCM takes the highest power of every prime that appears in either number, while the GCD takes the lowest. Edge cases: lcm(a, 0) is conventionally 0 (or undefined as a 'smallest positive multiple', since 0 is a multiple of everything), and lcm(a, 1) = a. For coprime numbers, where gcd = 1, the LCM is simply the product a × b. The LCM is what you need for a common denominator when adding fractions and for finding when two periodic events next coincide.

How to use

Example 1 — lcm(12, 8). Enter First Number = 12 and Second Number = 8. First gcd(12, 8) = 4 (since 12 = 1·8 + 4, then 8 = 2·4 + 0). Then lcm = (12 × 8) / 4 = 96 / 4 = 24. Verify with multiples: multiples of 12 are 12, 24, 36...; multiples of 8 are 8, 16, 24...; the first shared value is 24. Example 2 — lcm(15, 20). Enter First Number = 15 and Second Number = 20. gcd(15, 20) = 5, so lcm = (15 × 20) / 5 = 300 / 5 = 60. Verify by prime factors: 15 = 3·5 and 20 = 2²·5, so the LCM takes 2², 3, and 5 → 4·3·5 = 60.

Frequently asked questions

Why divide by the GCD instead of just multiplying the two numbers?

Multiplying a × b gives a common multiple, but usually not the LEAST one, because it counts the shared factors twice. Dividing by gcd(a, b) removes that duplication and leaves the smallest multiple both numbers share. For example, 12 × 8 = 96 is a common multiple, but the true LCM is 96 / 4 = 24, four times smaller. Only when the numbers are coprime (gcd = 1) does the plain product equal the LCM. Skipping the GCD division is the most common error and yields a valid but unnecessarily large common multiple.

How is the LCM used when adding fractions?

To add fractions you need a common denominator, and the least common denominator is exactly the LCM of the original denominators. For instance, to add 1/12 + 1/8 you compute lcm(12, 8) = 24, rewrite the fractions as 2/24 + 3/24, and add to get 5/24. Using the LCM keeps the numbers as small as possible, making the arithmetic and any later simplification easier. You can use the plain product of denominators instead, but you will then often need to reduce the result. This is the everyday reason students first meet the LCM.

What is the relationship between LCM and GCD?

They are tied together by the identity gcd(a, b) × lcm(a, b) = |a × b|, which holds for all positive integers. In prime-factor terms, the GCD takes the lowest power of each shared prime while the LCM takes the highest power of every prime in either number, so together they account for the full product. This means you can always derive one from the other once you know the numbers' product. A common conceptual mistake is treating them as unrelated; in fact they are two sides of the same factorization. Confusing which one to use — shared factors versus shared multiples — is the usual source of error.

How do I find the LCM of more than two numbers?

Apply the operation iteratively: lcm(a, b, c) = lcm(lcm(a, b), c), and continue for additional values. For example, lcm(4, 6, 10) = lcm(lcm(4, 6), 10) = lcm(12, 10) = 60. A basic two-input calculator handles only a pair, so you feed the running result back in with each new number. Be careful to use the intermediate LCM, not the original numbers, at each step. This stepwise approach also works for the GCD and is the standard way to extend either operation to a whole list.

When should I NOT use an LCM calculator?

Do not use it when you actually need shared factors rather than shared multiples — simplifying a fraction or reducing a ratio calls for the GCD instead. It is also inappropriate for non-integer inputs, since the LCM is defined only for whole numbers; clear any decimals or fractions first. If one of your inputs is 0, the 'smallest positive common multiple' is not well defined, so the result is not meaningful for scheduling-type problems. For tasks that need every common multiple or a full factor list, a factorization tool is more useful than the single LCM. Match the tool to whether you need multiples, factors, or a complete factorization.

Sources & references