GCD and LCM Calculator

Find the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or more numbers instantly.

How It Works

Enter two or more integers separated by commas. The calculator finds:

  • GCD — Uses the Euclidean algorithm: repeatedly divide the larger number by the smaller and take the remainder until it reaches zero. For multiple numbers, the GCD is computed pairwise.
  • LCM — Computed using the formula LCM(a, b) = |a × b| / GCD(a, b). For multiple numbers, the LCM is computed pairwise.

Frequently Asked Questions

What is the GCD (Greatest Common Divisor)?

The GCD is the largest positive integer that divides two or more numbers without leaving a remainder. For example, the GCD of 12 and 18 is 6.

What is the LCM (Least Common Multiple)?

The LCM is the smallest positive integer that is divisible by all given numbers. For example, the LCM of 4 and 6 is 12.

How are GCD and LCM related?

For two numbers a and b: GCD(a, b) × LCM(a, b) = a × b. This relationship is useful for computing one from the other.

What algorithm is used to find the GCD?

This calculator uses the Euclidean algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller number until the remainder is zero.

Related Calculators