LCM / GCD Calculator
Find the least common multiple and greatest common divisor of two or more numbers.
GCD (greatest common divisor) is what you need to simplify a fraction to lowest terms; LCM (least common multiple) is what you need to find a common denominator before adding fractions, or to figure out when two repeating events next line up. This handles either one, for two numbers or a longer list at once.
Example: For 18, 24, and 30, the GCD is 6 (the largest number that divides all three evenly) and the LCM is 360 (the smallest number all three divide into evenly) — useful for simplifying a three-way ratio or scheduling three events that repeat every 18, 24, and 30 days.
How it works
- Enter two or more positive whole numbers, separated by commas
- Press Calculate
- The GCD and LCM appear instantly, computed on your device using the Euclidean algorithm
Frequently asked questions
What's the difference between LCM and GCD?
GCD (greatest common divisor) is the largest number that divides every input evenly — used to simplify fractions and ratios. LCM (least common multiple) is the smallest number that every input divides into evenly — used to find a common denominator or line up repeating events.
How is GCD calculated?
Using the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller number, until the remainder is zero — the last nonzero remainder is the GCD. It's far faster than checking every possible divisor by hand.
Is my numbers uploaded anywhere?
No — LCM / GCD Calculator runs entirely in your browser using JavaScript/WebAssembly. Your numbers is never sent to a server.