Find LCM and GCD of any set of numbers.
🔢 GCD = largest number dividing all inputs. LCM = smallest number divisible by all inputs.
The LCM & GCD Calculator is based on the following formula:
GCD via Euclid LCM(a, b) = (a × b) / GCD(a, b)
Variables: GCD(a, b) = Greatest common divisor LCM(a, b) = Least common multiple a, b = Positive integers
The GCD is found by repeated remainder (Euclid's algorithm). The LCM follows from the identity linking the two — multiplying the numbers and dividing by their GCD.
Worked example: Step 1: Euclid for GCD(12, 18): 18 mod 12 = 6; 12 mod 6 = 0, so GCD = 6. Step 2: a × b = 12 × 18 = 216. Step 3: LCM = 216 / 6 = 36. Result: GCD(12, 18) = 6 and LCM(12, 18) = 36.
This calculator finds the GCD (greatest common divisor) and LCM (least common multiple) of any set of positive integers. These are fundamental concepts in number theory with practical uses in math and programming.
For any two numbers: GCD(a,b) × LCM(a,b) = a × b. So if you know one, you can find the other instantly. This calculator uses the efficient Euclidean algorithm, which works even for very large numbers.
More tools you might find useful
Exact Powerball, Mega Millions, and EuroMillions odds - or your own pools.
Find the value at any percentile of your data.
Calculate permutations (arrangements where order matters).
Decompose any number into its prime factors.