LCM Calculator
Find the Least Common Multiple (LCM) of two integers instantly.
Did this tool answer your question?
Thanks — this helps us improve the tool.
How to use this tool
- Enter first number and second number in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your lcm and the full breakdown beneath it.
Find the Least Common Multiple (LCM) of two integers.
Formula
LCM(a, b) = (a × b) ÷ GCD(a, b)
GCD is found via the Euclidean algorithm: replace (a, b) with (b, a mod b) until b = 0.
How it works
The calculator computes the Least Common Multiple by first finding the Greatest Common Divisor of the two inputs using the Euclidean algorithm, then applying the identity LCM = (a × b) / GCD(a, b). Both inputs are treated as absolute values. This approach avoids the overflow risk of listing multiples and is exact for any pair of integers.
Worked example
- Start: a = 4, b = 6
- Euclidean GCD: 6 mod 4 = 2; 4 mod 2 = 0 ⇒ GCD = 2
- LCM = (4 × 6) ÷ 2 = 24 ÷ 2 = 12
LCM(4, 6) = 12.
Common mistakes to avoid
- Confusing LCM with GCD -- LCM gives the smallest common multiple (used for adding fractions or synchronizing repeating events), not the largest common divisor.
- Entering zero as one input without realising LCM(0, n) = 0 by mathematical convention, which is correct but almost always signals a data-entry mistake.
- Assuming LCM is always larger than both inputs -- LCM(1, n) = n and LCM(n, n) = n, which can look unexpectedly small even though the calculation is correct.
Key terms
- Least Common Multiple (LCM)
- The smallest positive integer that is a multiple of both given integers; used in fraction arithmetic and scheduling problems.
- Greatest Common Divisor (GCD)
- The largest integer that divides both numbers exactly; used here as an intermediate step to compute the LCM efficiently.
- Multiple
- The product of an integer and any positive integer; e.g., multiples of 4 are 4, 8, 12, 16, …
- LCM identity
- The mathematical relationship LCM(a, b) = |a × b| / GCD(a, b), which lets you compute the LCM without listing all multiples.
- Adding fractions
- A common application of LCM: to add fractions with different denominators, find the LCM of the denominators to obtain the lowest common denominator.
Frequently asked questions
- What is LCM?
- The Least Common Multiple (LCM) of two integers is the smallest positive integer that is divisible by both numbers.