Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Least Common Multiple Calculator, with full prime factorization.

Calculate the LCM of two or more integers, with step-by-step prime factorization, a visual factor table showing which prime powers contribute to the result, and the GCD computed alongside. Enter up to 20 numbers at once.

Full guideReal-time

Inputs

Enter integers

Quick examples

3 numbers · max 20

1
2
3

Enter 2–20 positive integers. Results update instantly as you type.

Least Common Multiple

72

Greatest Common Divisor

6

GCD of the same 3 numbers

LCM formula

2³ × 3² = 8 × 9 = 72

Factor table

Prime factorizations

2 distinct primes
Number23Factorization
1232² × 3
1822 × 3²
2432³ × 3
LCM = 722³ × 3²

Highlighted cells (amber) = highest power of that prime used in the LCM.

Working

Step-by-step

LCM via prime factorization

  1. Step 1: Prime factorize each number:
  2. 12 = 2² × 3
  3. 18 = 2 × 3²
  4. 24 = 2³ × 3
  5. Step 2: Take the highest power of each prime:
  6. 2: max(2, 1, 3) = 3 → 2³ = 8
  7. 3: max(1, 2, 1) = 2 → 3² = 9
  8. Step 3: LCM = 2³ × 3² = 8 × 9 = 72

GCD via Euclidean algorithm

  1. GCD via Euclidean algorithm:
  2. GCD(12, 18) = 6
  3. GCD(6, 24) = 6
  4. GCD = 6

Multiples

First 8 multiples of 72

×172
×2144
×3216
×4288
×5360
×6432
×7504
×8576

Complete guide

What is the Least Common Multiple?

The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by every number in the set without leaving a remainder. Also called the lowest common multiple or smallest common multiple, it is the foundation for adding fractions with different denominators, synchronising repeating events, and many problems in number theory.

Example: The LCM of 4 and 6 is 12, because 12 is the smallest number that is a multiple of both 4 (4, 8, 12, 16…) and 6 (6, 12, 18…).

How to find the LCM, with just three methods

Method 1: Prime factorization (most educational)

This is the method shown in the factor table above. Break each number into its prime factors, then for each prime take the highest exponent that appears in any of the numbers, and multiply all these prime powers together:

LCM(12, 18, 24):

12 = 2² × 3¹
18 = 2¹ × 3²
24 = 2³ × 3¹

Primes present: 2 and 3
Highest power of 2: max(2, 1, 3) = 3 → 2³ = 8
Highest power of 3: max(1, 2, 1) = 2 → 3² = 9

LCM = 2³ × 3² = 8 × 9 = 72

Method 2: Using GCD (most efficient for two numbers)

The LCM and GCD are linked by the identity:

LCM(a, b) = |a × b| / GCD(a, b)

LCM(12, 18):
GCD(12, 18) = GCD(18, 12) = GCD(12, 6) = GCD(6, 0) = 6
LCM = (12 × 18) / 6 = 216 / 6 = 36

For more than two numbers, apply the formula repeatedly: LCM(a, b, c) = LCM(LCM(a, b), c).

Method 3: Listing multiples (only practical for small numbers)

Write out multiples of each number until a common value appears:

LCM(4, 6):
Multiples of 4: 4, 8, 12, 16, 20…
Multiples of 6: 6, 12, 18, 24…
First common multiple: 12
LCM(4, 6) = 12

LCM reference table for common pairs

NumbersGCDLCMLCM formula
2, 3162¹ × 3¹
4, 62122² × 3
6, 82242³ × 3
9, 123362² × 3²
10, 155302 × 3 × 5
12, 186362² × 3²
4, 6, 82242³ × 3
3, 5, 711053 × 5 × 7
12, 18, 246722³ × 3²
15, 20, 2553002² × 3 × 5²

The relationship between LCM and GCD

The LCM and GCD (Greatest Common Divisor) are complementary concepts. While the GCD is the largest number that divides all the inputs, the LCM is the smallest number that all inputs divide into. They are related by:

For any two positive integers a and b:
LCM(a, b) × GCD(a, b) = a × b

Example: LCM(12, 18) = 36, GCD(12, 18) = 6:
36 × 6 = 216 = 12 × 18 ✓

This identity means that once you know either the LCM or the GCD, you can find the other without factorising: if you know the GCD from Euclid's algorithm, compute the LCM directly.

LCM and fractions: finding the LCD

The Least Common Denominator (LCD) of two or more fractions is the LCM of their denominators. It is the smallest denominator that all fractions can be rewritten with, enabling addition and subtraction:

Add 1/4 + 1/6:

LCD = LCM(4, 6) = 12
1/4 = 3/12
1/6 = 2/12
1/4 + 1/6 = 3/12 + 2/12 = 5/12

Without the LCD, adding fractions requires expanding to a common denominator that might not be the smallest — the arithmetic still works but the result requires additional simplification.

LCM in scheduling and repeating events

Any problem involving two or more periodic events that must coincide reduces to an LCM calculation:

  • Traffic lights: Light A cycles every 40 seconds, Light B every 60 seconds. They next synchronise at LCM(40, 60) = 120 seconds (2 minutes).
  • Gear teeth: Two meshing gears with 12 and 18 teeth return to the same starting position every LCM(12, 18) = 36 tooth engagements.
  • Planetary conjunctions: Planets with orbital periods of 12 years (Jupiter) and 30 years (Saturn) align every LCM(12, 30) = 60 years.
  • Music: A rhythm on beat 3 and a rhythm on beat 4 both land on beat 1 every LCM(3, 4) = 12 beats.

Prime numbers and the LCM

The LCM of a set of distinct prime numbers is simply their product, because distinct primes share no common factors:

LCM(2, 3, 5, 7) = 2 × 3 × 5 × 7 = 210
LCM(2, 3, 5, 7, 11) = 2 × 3 × 5 × 7 × 11 = 2310

This means the LCM grows rapidly when inputs are coprime (share no common factors). Two numbers are coprime if and only if their GCD is 1, in which case their LCM equals their product.

Special cases

  • LCM(n, 1) = n: 1 divides every integer, so adding 1 to a set never changes the LCM.
  • LCM(n, n) = n: The LCM of a number with itself is the number.
  • LCM(a, b) = a × b when GCD(a, b) = 1: Coprime numbers have an LCM equal to their product.
  • LCM of multiples: LCM(6, 12, 24) = 24, because 24 already contains 6 and 12 as factors.