LCM Calculator
Find the Least Common Multiple (LCM) of two or more numbers using the GCD-based method. Also shows the Greatest Common Divisor (GCD).
About this Calculator
Find the Least Common Multiple (LCM) of two or more numbers using the GCD-based method. Also shows the Greatest Common Divisor (GCD).
Formula & Calculations
Formula
LCM(a,b) = |a*b| / GCD(a,b)Where:
- LCM=The smallest positive integer that is a multiple of all input numbers
- GCD=The largest positive integer that divides all input numbers without a remainder
- a, b, c, ...=Two or more positive integers
Assumptions
- All input numbers must be positive integers.
- LCM is computed pairwise using the relationship LCM(a,b) = |a*b| / GCD(a,b).
- The result may be very large for large inputs.
Calculation Examples
Example 1
Inputs:12, 18, 30
Result:LCM = 180, GCD = 6
LCM(12,18) = 36, LCM(36,30) = 180. GCD(12,18) = 6, GCD(6,30) = 6.
Example 2
Inputs:8, 20
Result:LCM = 40, GCD = 4
LCM = |8*20| / GCD(8,20) = 160 / 4 = 40.
Frequently Asked Questions
What is the difference between GCD and LCM?
GCD is the largest number that divides all inputs evenly. LCM is the smallest number that all inputs divide into evenly. They are related by: LCM(a,b) × GCD(a,b) = |a × b|.
Can I compute LCM of more than two numbers?
Yes. LCM is associative: LCM(a,b,c) = LCM(LCM(a,b), c). The calculator applies the formula pairwise for any number of inputs.