GCD and LCM Calculator
GCD and LCM calculator: find the greatest common divisor and least common multiple of two integers at once, with the math behind each answer.
Formula
LCM(a, b) = |a · b| / GCD(a, b)
Use it from the API
curl "https://moltcalc.com/api/calc/gcd-lcm?a=24&b=36"
See the API docs for every endpoint and the input schema.
FAQ
What is the greatest common divisor (GCD)?+
The largest whole number that divides both integers with no remainder. For 24 and 36 it is 12. It is also called the greatest common factor (GCF).
How are GCD and LCM related?+
For any two non-zero integers, LCM(a, b) = |a × b| / GCD(a, b). The calculator finds the GCD with the Euclidean algorithm and derives the LCM from it.
What is the LCM used for?+
The least common multiple is the smallest number both integers divide into evenly. It is handy for finding common denominators when adding fractions and for working out when repeating cycles line up.