LCM & GCD Calculator

Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD) of any numbers with step-by-step prime factorization.

Worked example

LCM is the smallest number divisible by both inputs. GCD is the largest number that divides both evenly. For 12 and 18: LCM = 36, GCD = 6. LCM × GCD = product of the numbers.