How to Find the GCD and LCM of Two Numbers
Last updated 2026-09-12
GCD and LCM are two related ways of describing how two numbers relate to each other — one finds their largest shared factor, the other their smallest shared multiple.
Find the GCD using repeated division (the Euclidean algorithm)
Divide the larger number by the smaller, take the remainder, then repeat with the smaller number and that remainder until the remainder is 0. The last non-zero remainder is the GCD.
Find the LCM from the GCD
LCM(a, b) = (a × b) ÷ GCD(a, b) — once you have the GCD, the LCM follows directly from this formula.
Example
GCD(12, 18): 18 ÷ 12 = 1 remainder 6; 12 ÷ 6 = 2 remainder 0 → GCD is 6. LCM(12, 18) = (12 × 18) ÷ 6 = 36.
Important Considerations
- The GCD of two numbers is always less than or equal to the smaller of the two.
- The LCM of two numbers is always a multiple of both, and always greater than or equal to the larger of the two.
- If two numbers share no common factors other than 1 (they're "coprime"), their GCD is 1 and their LCM is simply their product.
Frequently Asked Questions
- What is GCD used for in real life?
- Simplifying fractions to lowest terms, and dividing items or people into equal groups without leftovers.
- What is LCM used for in real life?
- Finding a common denominator when adding fractions, and scheduling problems — like figuring out when two repeating events next coincide.