Greatest common divisor and least common multiple
The GCD is the largest number that divides every value in your list with no remainder; the LCM is the smallest number that every value divides into. Enter two or more whole numbers and this calculator returns both at once — the two quantities you need for simplifying fractions and syncing repeating cycles.
How they are found
The GCD comes from the Euclidean algorithm: repeatedly replace the larger number by its remainder against the smaller until one becomes zero. The LCM then follows from the identity LCM(a, b) = a times b divided by GCD(a, b), applied across the list one pair at a time.
Where each is used
GCD reduces a fraction to lowest terms — divide top and bottom by it. LCM gives the common denominator for adding fractions, and answers timing puzzles like when two events that recur on different cycles next coincide.
Related tools
To see the prime building blocks behind these, use the prime factorization calculator; for remainders, the modulo calculator.
Worked example
For 12, 18, and 24: the GCD is 6 (the biggest number dividing all three) and the LCM is 72 (the smallest each divides into).
FAQ
Can I enter more than two numbers?
Yes. The calculator folds the GCD and LCM across the whole list, pair by pair, so any count of two or more works.
What if a number is zero or negative?
Use positive whole numbers. Zero has no well-defined LCM here, and signs are ignored for divisibility.
