Calculate the greatest common divisor (GCD) and least common multiple (LCM) of two or more numbers.
Last updated: October 18, 2026
Greatest common divisor and least common multiple concepts
GCD (Greatest Common Divisor) is the largest positive integer that divides two or more numbers evenly. LCM (Least Common Multiple) is the smallest positive integer that is a multiple of all these numbers. These two concepts are frequently used in mathematics and daily life.
Euclidean Algorithm: The most efficient method for calculating GCD. Divide the larger number by the smaller, take the remainder. Replace the smaller number with the remainder. Continue until remainder is 0. The last non-zero remainder is the GCD. This method has been used since 300 BC!
Practical applications: Simplifying fractions (numerator and denominator are divided by GCD). Finding common denominators for fraction operations (LCM is used). Equal group division problems (GCD for largest group). Calculating periodic events (when do two events occur simultaneously? LCM). In puzzles and logic problems. GCD and LCM are cornerstones of number theory.
Short answers to common questions
GCD (Greatest Common Divisor) is the largest positive integer that divides two or more numbers evenly. It's calculated using the Euclidean Algorithm: Divide the larger by the smaller, take the remainder, replace the smaller with the remainder, and continue until remainder is 0. Example: GCD(48, 18) = 6
LCM (Least Common Multiple) is the smallest positive integer that is a multiple of all given numbers. It's calculated using the formula: LCM(a,b) = (a × b) / GCD(a,b). Example: LCM(12, 18) = (12 × 18) / 6 = 36
The product of two numbers equals the product of their GCD and LCM: a × b = GCD(a,b) × LCM(a,b). This property allows easy calculation of LCM when GCD is known, or vice versa.
The Euclidean Algorithm finds the GCD directly without factoring into primes. It's much faster for large numbers. For example, it finds GCD(1071, 462) in just a few steps.
GCD: Simplifying fractions, dividing into equal groups, finding common factors. LCM: Time problems (periodic events), fraction operations, finding common denominators, calculating regularly recurring events.
For multiple numbers' GCD: Find GCD of first two, then find GCD of result with third number, continue. Same method for LCM. Example: GCD(12, 18, 24) = GCD(GCD(12, 18), 24) = GCD(6, 24) = 6
When the GCD of two numbers is 1, they are called 'relatively prime' or 'coprime'. They have no common divisors except 1. Example: GCD(15, 28) = 1, so 15 and 28 are relatively prime.
More tools for similar calculations
You can enter 2-10 integers
Calculation Steps
GCD
18 = 12 × 1 + 6 12 = 6 × 2 + 0
LCM
LCM(12, 18) = |12 × 18| / GCD(12, 18) = 216 / 6 = 36