Smallest multiple of both numbers.
LCM(a, b) = |a × b| ÷ GCD(a, b)
The most efficient way to compute the LCM of two integers a and b is through their Greatest Common Divisor (GCD), using the identity:
LCM(a, b) = |a × b| ÷ GCD(a, b)
This works because the product of two numbers equals the product of their LCM and GCD. For more than two numbers, apply the formula iteratively:
LCM(a, b, c) = LCM(LCM(a, b), c)
The GCD itself is most efficiently found using the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing the larger by the smaller until the remainder is zero; the last non-zero remainder is the GCD.
Step 1 – Find GCD(12, 18) using the Euclidean algorithm: 18 ÷ 12 = 1 remainder 6 12 ÷ 6 = 2 remainder 0 → GCD(12, 18) = 6 Step 2 – Apply the LCM formula: LCM(12, 18) = |12 × 18| ÷ 6 = 216 ÷ 6 = 36
Result: LCM(12, 18) = **36**
The result 36 is the smallest positive integer that both 12 and 18 divide into evenly. You can verify: 36 ÷ 12 = 3 (no remainder) and 36 ÷ 18 = 2 (no remainder). No positive integer smaller than 36 satisfies both conditions.
The LCM appears in many practical situations:
Method 1 – Using the GCD (recommended for large numbers) As shown in the formula, dividing the product of the two numbers by their GCD is fast and minimises arithmetic, especially for large values.
Method 2 – Prime Factorisation
Example with 12 and 18:
| | GCD | LCM | |---|---|---| | Definition | Largest common divisor | Smallest common multiple | | Use case | Simplifying fractions | Finding common denominators | | Relationship | GCD(a,b) × LCM(a,b) = a × b | same identity |
For any two positive integers a and b, the product of their LCM and GCD always equals the product of the numbers themselves: LCM(a, b) × GCD(a, b) = a × b. This identity is the basis of the fastest LCM calculation method.
To add fractions with different denominators, find the LCM of the denominators to get the lowest common denominator. Convert each fraction to an equivalent fraction with that denominator, then add the numerators. For example, 1/12 + 1/18 uses LCD = LCM(12,18) = 36, giving 3/36 + 2/36 = 5/36.
Any two distinct prime numbers are coprime (GCD = 1), so their LCM is simply their product. For example, LCM(7, 13) = 91. For a prime p and a composite number n, LCM(p, n) = p × n if p does not divide n, otherwise LCM(p, n) = n.
The LCM is typically defined for positive integers. Some definitions extend it to negative integers by taking absolute values first, so LCM(−12, 18) = LCM(12, 18) = 36. Our calculator works with positive integers only.
Mathematically, the LCM is undefined when either input is 0, because zero has no positive multiples. Our calculator requires positive integers greater than zero.
No. By definition, the LCM must be divisible by every input number, so it is always greater than or equal to the largest number in your list. It equals the largest input only when the largest input is itself a multiple of all the others.
Apply the formula iteratively: compute LCM of the first two numbers, then compute the LCM of that result with the third number, and so on. Our calculator handles this automatically when you add extra number fields.
Yes — when adding or subtracting fractions, the LCD of the denominators is exactly the LCM of those denominators. Using the LCM keeps the numbers as small as possible.
No. LCM is commutative and associative: LCM(a, b) = LCM(b, a), and the order in which you process a list of numbers does not affect the final answer.
Only sources that have been reviewed are shown. Unverified citations are never published.