IQRCalculator

LCM Calculator

The smallest positive number that every number in your list divides into, worked out from prime factors and the GCF.

Two to twenty whole numbers, separated by commas or spaces.

Result

Least common multiple604, 6, 15
GCF
1
LCM
60
How it was calculated
  1. Work through the list pairwise
    LCM so far: 4 → 12 → 60
  2. Prime factorizations
    NumberPrime factors
    422
    62 × 3
    153 × 5

    LCM: multiply every prime that appears, each at its highest power.

How to use it

Enter 2 to 20 whole numbers separated by commas or spaces. The calculation is exact for numbers of up to 30 digits each, and the result can be far larger than any input: when no two of the numbers share a factor, the LCM is their product.

The formulas

LCM(a, b) = |a × b| ÷ GCF(a, b)
LCM(a, b, c) = LCM(LCM(a, b), c)GCF — greatest common factor; the second line extends the first to any number of values

Through prime factorization: write each number as a product of primes, then multiply every prime that appears in any of them, each at its highest power. The GCF calculator uses the same factorizations but keeps only the shared primes, at their lowest powers.

For two numbers the calculator shows Euclid’s algorithm for the GCF and then the division above. When every number is between 2 and 1015 in size, it adds a table of prime factorizations.

Worked examples

LCM of 4, 6 and 15

Given: 4, 6, 15

  • 4 = 22
  • 6 = 2 × 3
  • 15 = 3 × 5

Every prime that appears, at its highest power: 22 × 3 × 5 = 60. Check: 60 ÷ 4 = 15, 60 ÷ 6 = 10 and 60 ÷ 15 = 4, and no smaller positive number works for all three.

Two numbers with the GCF shortcut

Given: 12, 18

Euclid’s algorithm gives GCF(12, 18) = 6 (18 = 1 × 12 + 6, then 12 = 2 × 6 + 0). So LCM = 12 × 18 ÷ 6 = 216 ÷ 6 = 36.

A typical use: two buses leave the same stop every 12 and 18 minutes. If they leave together now, they next leave together in 36 minutes.

Conventions and edge cases

  • Negative numbers: signs are ignored and the LCM is reported as non-negative, so LCM(−4, 6) = 12.
  • Zero: if any number is 0, the LCM is 0, because 0 is the only multiple of 0. Some textbooks instead leave the LCM undefined when a 0 is involved.
  • No common factor: when the GCF is 1, the LCM of two numbers is simply their product, for example LCM(8, 15) = 120.
  • Only integers are accepted; decimals are rejected.

LCM and common denominators

The least common denominator of two fractions is the LCM of their denominators. To add 1/4 + 1/6, use LCM(4, 6) = 12: 3/12 + 2/12 = 5/12. The plain product 24 also works as a denominator, but the sum then needs reducing. The fraction calculator finds the common denominator automatically.

Questions

What is the difference between the LCM and the GCF?

The GCF is the largest number that divides into all of them, so it is never larger than the smallest; the LCM is the smallest number they all divide into, so it is never smaller than the largest. For 12 and 18: GCF 6, LCM 36.

Does GCF × LCM = product work for three numbers?

No, only for two. For 12 and 18, 6 × 36 = 216 = 12 × 18. For 4, 6 and 15 the GCF is 1 and the LCM is 60, but the product is 360.

Can the LCM equal one of the numbers?

Yes, when the largest number is a multiple of all the others. LCM(3, 6, 12) = 12.

Method & sources