Find the least common multiple and greatest common factor of two to ten positive integers. Use it to align repeating counts or find a common denominator.
How it works
Euclid's algorithm repeatedly replaces a pair by the smaller number and the remainder until the remainder is zero. For positive a and b, LCM(a,b) = (a/GCD(a,b)) × b. Repeat for additional inputs. The explanation also combines the highest exponent of each prime in the input factorizations.
Worked examples
For 12 and 18, Euclid's algorithm gives gcd=6. LCM=(12/6)×18=36. Their prime forms are 2²×3 and 2×3², whose highest powers also give 2²×3²=36.
For 12, 18 and 24, first obtain LCM(12,18)=36. Then gcd(36,24)=12, so LCM(36,24)=(36/12)×24=72.
Two ways to find the same multiple
List positive multiples of 12: 12, 24, 36, 48, 60, 72. For 18, the list begins 18, 36, 54, 72. The first shared entry is 36, so it is the least common multiple. Although 72 is also common, it is not the least. Listing is easy for small numbers but becomes inefficient when the first match is far away.
Prime factorization avoids long lists. Write 12 = 2² × 3 and 18 = 2 × 3². A common multiple needs enough factors to contain both inputs, so take the highest exponent of each prime: 2² × 3² = 36. The GCD instead takes shared primes at their lowest exponents: 2 × 3 = 6. Consequently LCM × GCD = 36 × 6 = 216 = 12 × 18.
Using the answer without confusing LCM and GCD
Suppose two events repeat every 12 and 18 minutes and occur together now. They next coincide after 36 minutes, provided both schedules continue unchanged. If their starting times differ, the LCM alone does not tell you when they first coincide; the starting offsets also matter.
For fractions, 36 is the smallest common denominator for 1/12 and 1/18: rewrite them as 3/36 and 2/36, giving 5/36. Multiplying the denominators gives 216, which works but requires more reduction. The product equals the LCM only when the two inputs are coprime.
Do not apply the two-number product identity directly to three numbers. For 12, 18 and 24, the LCM is 72 and the GCD is 6, but their product is not 12 × 18 × 24. Combine pairs successively instead. Remember that this form rejects zero by policy even though a common mathematical convention defines LCM(0,n) as zero.
How to read your result
This form accepts positive integers only: zero and negative values are rejected rather than silently reinterpreted. Each input is capped at 10,000,000 to keep trial factorization responsive. Exact intermediate arithmetic is used, but results above 9,007,199,254,740,991 are rejected because the displayed result uses a JavaScript number. Blank entries and fractional inputs are errors.
For related calculations, try gcf calculator, factor calculator, prime factorization calculator.
Frequently asked questions
How do I find the LCM of two numbers?
Divide the first positive integer by the pair's greatest common divisor, then multiply by the second. For 12 and 18 this gives (12/6)×18=36.
Is the LCM always the product?
Only when the numbers are coprime. Shared factors reduce the least common multiple below the product.
Can I enter zero or negative numbers?
Not in this form. It is defined for positive integers only. Other mathematical conventions extend LCM to zero and signed integers, but this interface rejects those inputs explicitly.
What happens when I enter 1?
One is accepted. LCM(1,n)=n; if all entries are 1, both LCM and GCF are 1. One has no prime factors.
What is the largest supported value?
Each input may be at most 10,000,000. The resulting LCM must not exceed 9,007,199,254,740,991; larger results produce a validation error instead of an approximate integer.
When does the LCM equal the product?
For two positive integers, it equals their product exactly when their GCD is 1. For example, 13 and 17 are coprime, so their LCM is 221.
Sources: Standard definitions of LCM and GCD; Euclid's algorithm; fundamental theorem of arithmetic.
Last reviewed: November 3, 2026
