The least common multiple (LCM) of two or more 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 both a multiple of 4 (4, 8, 12, …) and a multiple of 6 (6, 12, …). It is also called the lowest or smallest common multiple, and it sits beside the greatest common factor (GCF, sometimes written GCD) as one of the two workhorses of elementary number theory. To calculate LCM in maths you have three reliable routes: list the multiples of each number until one appears in two lists, write each number as a product of primes and combine the highest powers that appear, or apply the closed-form expression lcm(a, b) = |a × b| ÷ gcd(a, b), where the gcd is the greatest common divisor found with the Euclidean algorithm. The formula is the fastest reliable method for any size of input, because dividing before multiplying keeps the intermediate numbers as small as possible. For more than two numbers the same formula is folded pairwise, so lcm(3, 4, 5) becomes lcm(lcm(3, 4), 5) = lcm(12, 5) = 60, and the final LCM is the same regardless of the order you enter the values. Together, the GCD and LCM give you everything you need to combine fractions and to simplify the results.

how to calculate lcm in maths
How to Calculate LCM in Maths: Formulas and Steps

What LCM Means in Maths

The word least in least common multiple means smallest, common means shared, and multiple means a product of the integer with a positive whole-number count. The multiples of 4 are 4, 8, 12, 16, 20, 24, …; the multiples of 6 are 6, 12, 18, 24, …. The numbers that appear in both lists — 12, 24, 36, … — are the common multiples, and the smallest of them is the LCM. By construction, every common multiple of a set of integers is also a multiple of the LCM, so once you know the LCM you can write down any common multiple as k × LCM for a positive integer k.

The LCM is unique for any non-empty set of positive integers, and it is always at least as large as the largest number in the set. If one of the numbers already divides all of the others, the LCM is just that largest number — for 3, 6, and 12 the LCM is 12, because 12 is the smallest number that 3, 6, and 12 all divide into evenly. The LCM is also linked to the GCF by the identity a × b = gcd(a, b) × lcm(a, b), which is what allows the lcm(a, b) = |a × b| ÷ gcd(a, b) formula to work without any guesswork.

The Three Methods for Finding LCM in Maths

Maths textbooks usually present three ways to find the LCM, each with its own strengths.

1. The listing method

Write the first several multiples of each number and look for the first match. For 4 and 6 you list 4, 8, 12, 16, 20, 24 and 6, 12, 18, 24, and you see that 12 is the first shared entry. This method is perfect for small numbers and for showing why the LCM exists, but it gets tedious once the inputs grow past two digits, because the answer can be far larger than either input.

2. The prime factorization method

Break each number into its prime factors, then take every prime that appears in any of the numbers to its highest power across the whole set and multiply. For 12 = 2² × 3 and 18 = 2 × 3², the primes that appear are 2 and 3, and the highest powers are 2² and 3², so the LCM is 2² × 3² = 36. This method is great for explaining why the answer is what it is, and a dedicated Prime Factorization Calculator can produce the factor trees for you. The downside is that factoring very large numbers is computationally hard, which is why the formula method below is preferred in software.

3. The GCD-product formula

Compute the greatest common divisor of the two numbers and divide the absolute product by it: lcm(a, b) = |a × b| ÷ gcd(a, b). For 4 and 6, gcd(4, 6) = 2, so lcm(4, 6) = (4 × 6) ÷ 2 = 12. The division step is usually performed first — (|a| ÷ gcd) × |b| — so the intermediate value never grows past the LCM itself. For three or more numbers, fold pairwise, for example lcm(3, 4, 5) = lcm(lcm(3, 4), 5) = lcm(12, 5) = 60. This is the method the LCM Calculator uses internally.

How to Calculate LCM in Maths Step by Step

  1. Open the LCM Calculator and type two or more whole numbers into the input box, separated by commas, spaces, or new lines — for example, 4, 6, 8.
  2. Read the LCM that appears instantly at the top of the result panel, with the greatest common factor (GCF or GCD) shown alongside — there is no button to press, because the answer updates as you type.
  3. Read the worked steps just below the answer to see how the LCM was folded pairwise using lcm(a, b) = |a × b| ÷ gcd(a, b), with each gcd found by the Euclidean algorithm.
  4. Scroll to the list of first common multiples to confirm that the displayed answer is genuinely the first shared multiple of every number in the input set.
  5. Copy or write down the LCM for your working, or share the page URL with a classmate if you need to send the calculation.

Worked Example: Finding the LCM of 4, 6, and 8

To show the formula in motion, take the three numbers 4, 6, and 8 and work the LCM by hand using the pairwise fold.

Step 1: Compute gcd(4, 6). Using the Euclidean algorithm, 6 = 1 × 4 + 2 and 4 = 2 × 2 + 0, so gcd(4, 6) = 2.

Step 2: lcm(4, 6) = (4 × 6) ÷ 2 = 24 ÷ 2 = 12.

Step 3: Compute gcd(12, 8). 12 = 1 × 8 + 4 and 8 = 2 × 4 + 0, so gcd(12, 8) = 4.

Step 4: lcm(12, 8) = (12 × 8) ÷ 4 = 96 ÷ 4 = 24.

So the LCM of 4, 6, and 8 is 24. A quick sanity check confirms it: 24 ÷ 4 = 6, 24 ÷ 6 = 4, and 24 ÷ 8 = 3, so 24 is a multiple of each input, and there is no smaller positive integer with that property. The same answer comes out of the LCM Calculator, which also displays the GCF (here, gcd(4, 6, 8) = 2) alongside the LCM.

Where LCM Appears in Real Maths Problems

The LCM shows up anywhere two or more integer-based cycles need to line up. In school maths, its main use is as the least common denominator when you add or subtract fractions with different bottoms. To add 1/4 and 1/6, you rewrite both over the LCD 12 — 1/4 = 3/12 and 1/6 = 2/12 — and then add the numerators for 5/12. Choosing the LCD instead of just multiplying the denominators keeps the numbers small and the answer close to lowest terms.

Beyond fractions, the LCM answers the question "when do these repeating cycles line up again?". Two buses leaving every 4 minutes and every 6 minutes will both be at the stop together every lcm(4, 6) = 12 minutes. The same idea governs gear teeth that mesh at fixed ratios, traffic lights on offset cycles, shift rotations, and repeating calendar patterns. Any time a problem talks about a shared period, the answer is almost always an LCM.

LCM vs GCF: Picking the Right Tool

The LCM and the GCF are mirror twins — the LCM is the smallest number all of your inputs divide into, while the GCF is the largest number that divides all of them. The two together contain every shared factor of the input, which is why they are computed together by both the LCM Calculator and the GCF Calculator.

Use caseWhat you wantUse
Adding or subtracting fractions with unlike denominatorsSmallest common denominatorLCM
Reducing a single fraction to lowest termsLargest common factor of numerator and denominatorGCF
Aligning repeating cycles (buses, lights, shifts)First time the cycles meetLCM
Tiling or packing where a common chunk size mattersLargest shared chunkGCF
Re-writing ratios in lowest termsLargest common factor of the partsGCF

For 4 and 6, the LCM is 12 and the GCF is 2. Use the LCM as the common denominator when you are combining fractions, and use the GCF to reduce them once you have a result. If your only goal is simplifying rather than combining, the GCF Calculator is the better starting point.

Input Rules and Edge Cases

The LCM Calculator accepts two or more whole numbers and applies a few rules so the answer is always well defined:

  • Zero is not allowed. If any number in the input is 0 the LCM is reported as undefined, because zero has no positive multiples and therefore no common multiple with the rest.
  • Decimals are rejected. Non-integers such as 1.5 are refused with a clear message, because the LCM is defined only for whole numbers.
  • Negative numbers use their absolute value. Multiples are positive quantities, so lcm(−4, 6) = lcm(4, 6) = 12.
  • Duplicate values do not change the result. Repeated entries simply combine with the rest; a single number returns itself as the LCM.
  • Very large inputs are flagged. Inputs beyond the safe integer range are marked so you know the answer may be rounded, because dividing before multiplying still has limits.

Every calculation runs in your browser, so no numbers are sent to a server. For homework, least common denominators, scheduling, or any situation that calls for an exact lowest-common-multiple answer, the LCM Calculator is the fastest way to get there and to see exactly why.

If you're weighing options, Steel Length to Weight: Formula and Step-by-Step Method covers this in detail.

If you're weighing options, How to Find Rounding Bottom Stocks: Exact Decimal Math covers this in detail.