Loading calculator...
Loading calculator...
Find the Least Common Multiple (LCM) and Greatest Common Divisor (GCD) of up to 5 numbers with step-by-step working.
LCM and GCD Formulas:
LCM(a, b) = (a × b) / GCD(a, b)
GCD: Euclidean algorithm — GCD(a, b) = GCD(b, a mod b)
For multiple numbers: LCM(a, b, c) = LCM(LCM(a, b), c)
GCD × LCM = a × b (for two numbers)
The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by all of them. For example, LCM(4, 6) = 12 because 12 is the smallest number divisible by both 4 and 6.
LCM is used to find a common denominator when adding or subtracting fractions. For example, to add 1/4 + 1/6, use the LCM of 4 and 6, which is 12: 3/12 + 2/12 = 5/12.
For two positive integers a and b: GCD(a, b) × LCM(a, b) = a × b. This identity makes it easy to compute the LCM once you know the GCD.
Compute LCM iteratively: LCM(a, b, c) = LCM(LCM(a, b), c). Start with the first two numbers, compute their LCM, then compute the LCM of that result with the next number, and so on.
The Euclidean algorithm efficiently finds the GCD by repeatedly applying: GCD(a, b) = GCD(b, a mod b) until the remainder is 0. For example: GCD(48, 36) → GCD(36, 12) → GCD(12, 0) = 12.