LCM Calculator

Find the least common multiple of two or more numbers instantly, together with their GCD and the working shown step by step. Free and private โ€” all math runs in your browser.

Whole numbers only, up to 200 digits each. Negative numbers are treated by their absolute value.

How to use the LCM calculator

  1. Enter your numbers. Type two or more whole numbers separated by commas, spaces or new lines โ€” for example 4, 6, 15.
  2. Read the LCM instantly. The least common multiple updates as you type, together with the GCD of the whole list.
  3. Check the steps. Each pairwise step shows the GCD and the formula lcm = a ร— b รท gcd, ready to copy into your notes.

About this tool

The least common multiple (LCM) of a set of numbers is the smallest positive number that every one of them divides evenly. This free LCM calculator computes it with the exact identity lcm(a, b) = |a ร— b| รท gcd(a, b), folding the list pairwise for three or more numbers, and it uses big-integer arithmetic so results with hundreds of digits are still exact โ€” no rounding, no overflow. The GCD of the whole list is shown alongside; you can explore it further with the GCD calculator.

The LCM is what you need to find a common denominator before adding or subtracting fractions, to work out when repeating events line up (two buses that leave every 12 and every 18 minutes meet every 36 minutes), and to solve gear, tiling and scheduling problems. Everything is calculated locally in your browser โ€” the numbers you enter are never uploaded, stored or logged.

Frequently asked questions

How is the LCM calculated?

For two numbers the tool uses lcm(a, b) = |a ร— b| รท gcd(a, b), where the GCD comes from the fast Euclidean algorithm. For three or more numbers it applies lcm(a, b, c) = lcm(lcm(a, b), c), repeating across the whole list.

What is the relationship between LCM and GCD?

For any two positive integers, LCM ร— GCD = a ร— b. That identity is exactly how this calculator computes the LCM without ever factoring the numbers. Note that it only holds for two numbers, not for longer lists.

What is the LCM if one of the numbers is 0?

The only multiple of 0 is 0 itself, so by convention lcm(0, n) = 0. The calculator returns 0 and shows a note explaining why whenever your list contains a zero.

Why do I need the LCM to add fractions?

To add 1/4 and 1/6 you rewrite both with a common denominator. The smallest one that works is the LCM of 4 and 6, which is 12: 3/12 + 2/12 = 5/12. Using the LCM keeps the numbers as small as possible.