GCD and LCM Calculator
Quick answer
The GCD is the largest number that divides all given numbers; the LCM is the smallest positive number that is a multiple of all of them. For two numbers, GCD × LCM = their product. The GCD of 12 and 18 is 6 and the LCM is 36.
Result
—
How to use the gcd & lcm calculator
Formula
- GCD (Euclid): gcd(a, b) = gcd(b, a mod b)
- LCM: |a × b| / gcd(a, b)
Worked example
For 12, 18 and 30: GCD 6, LCM 180.
Good to know
The GCD is computed with the Euclidean algorithm. LCM problems include finding when two repeating events coincide.
GCD & LCM Calculator: frequently asked questions
What does coprime mean?
Numbers whose GCD is 1, such as 8 and 15.
How many numbers can I enter?
As many as you like.