GCD & LCM Calculator

This calculator finds the GCD and LCM of integers for simplifying fractions, matching cycles, and the usual homework trouble.

The interactive gcd & lcm calculator loads right here. If it hasn't appeared, refresh the page.

Enter two or more positive integers. Use the GCD when you need the largest number that divides every input, and the LCM when you need the smallest positive number divisible by every input.

For two positive integers a and b, GCD(a, b) is found with repeated division using the Euclidean algorithm, and LCM(a, b) = |a × b| / GCD(a, b). For more values, apply each operation one pair at a time.

Worked example

For 18 and 24, the GCD is 6. The LCM is (18 × 24) / 6 = 72.

Common questions

What is the difference between GCD and LCM?

The GCD divides each input without a remainder. The LCM is divisible by each input without a remainder.

Can the GCD be larger than the inputs?

No, not for positive integers. It cannot exceed the smallest input.

Related math tools

More from DoesWhat: free calculators · emoji meanings · quick answers · the DoesWhat blog