LCM Calculator
Calculate the Least Common Multiple (LCM) of two or more numbers. Instant result in the browser.
What is LCM?
The Least Common Multiple (LCM) is the smallest positive number that is a multiple of two or more integers at the same time. You get it from the relation LCM(a,b) = (a × b) / GCD(a,b).
Taking LCM(4, 6) = (4×6)/GCD(4,6) = 24/2 = 12. A result like this is handy, for instance, when adding fractions with different denominators.
Least common multiple and how to compute it
The least common multiple lcm(a, b) is the smallest positive integer that is a multiple of both a and b. The fastest way to compute it goes through the GCD: lcm(a, b) = (a · b) / gcd(a, b). Example: lcm(4, 6) = (4 · 6) / gcd(4, 6) = 24 / 2 = 12. Because the Euclidean algorithm runs in O(log min(a, b)), the LCM is computed in logarithmic time too — much faster than listing multiples of each number until one matches.
An equivalent route uses prime factorisations: take every prime that appears in either factorisation, raised to the highest exponent it has in either number. For 12 = 2² · 3 and 18 = 2 · 3², the LCM is 2² · 3² = 36.
Where the LCM shows up
- Adding or subtracting fractions: the common denominator is the LCM of the denominators (
1/4 + 1/6 = 3/12 + 2/12 = 5/12). - Calendars and astronomy — solar and lunar cycles realign at the LCM of their periods (synodic periods).
- Gear trains — number of rotations before two meshed gears return to their initial relative position.
- Scheduling and traffic lights with different cycle lengths — the system repeats every LCM seconds.
FAQ
Why divide by the GCD instead of just multiplying? Because a · b counts shared prime factors twice. Dividing by the GCD removes the duplication so the result is the smallest common multiple, not just a common one.
What if one of the numbers is zero? By convention lcm(0, n) = 0, since 0 is a multiple of every integer.
How does LCM extend to three or more numbers? Apply it pairwise: lcm(a, b, c) = lcm(lcm(a, b), c). The operation is associative.
If the two numbers are coprime, what is the LCM? Simply their product — when gcd(a, b) = 1, the formula collapses to lcm(a, b) = a · b.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.
Calculate the LCM (least common multiple)
The least common multiple is the smallest number that is a multiple of two or more values at the same time. You need it to add fractions with different denominators and to solve problems of cycles that come back into sync. This calculator reaches the LCM without delay.
Enter two or more numbers and the result appears. It's what you use to add and subtract fractions, work out when two periodic events will coincide (think of two lights blinking at different intervals) or solve exercises that ask for the least common multiple.
The calculation runs in your own browser. A direct tool for an operation that keeps coming up at school and in everyday situations.