What are GCD and LCM
The GCD (Greatest Common Divisor) is the largest number that divides every number in the list with no remainder. The LCM (Least Common Multiple) is the smallest number that is a multiple of all of them at once. Both are core arithmetic concepts, used at school and in practical problems involving fractions and grouping.
How it is calculated
This calculator uses the Euclidean algorithm for the GCD: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is zero. The LCM comes from LCM(a, b) = (a × b) ÷ GCD(a, b), extended across the whole list.
Worked example
For 12 and 18: the common divisors are 1, 2, 3 and 6 — the GCD is 6. The common multiples start at 36 — the LCM is 36. Check: 12 × 18 ÷ 6 = 36.
Where it is used
GCD simplifies fractions to lowest terms and splits items into equal groups. LCM is essential for adding or subtracting fractions with different denominators, and for figuring out when periodic events (like two buses with different intervals) line up again.
Frequently asked questions
What is the GCD?
The largest integer that divides all the given numbers with no remainder.
What is the LCM?
The smallest integer that is a multiple of all the given numbers at once.
Can I calculate GCD/LCM for more than two numbers?
Yes, just separate the numbers with commas or spaces — the calculation is applied across the whole list.
What is the LCM used for in real life?
It is used to add fractions with different denominators and to find when repeating events happen at the same time again.