GCD/LCM Calculator

Enter two or more whole numbers to instantly calculate their Greatest Common Divisor (GCD) and Least Common Multiple (LCM), with the working steps shown below.

Whole positive numbers only. Separate with commas, spaces, or both.

How to Use the GCD/LCM Calculator

  1. Type two or more whole numbers into the input box, separated by commas or spaces.
  2. Click "Calculate GCD & LCM".
  3. The Greatest Common Divisor and Least Common Multiple appear instantly, along with a step-by-step breakdown of how each was calculated.

Why Use This Tool?

What is the difference between GCD and LCM?

The GCD (Greatest Common Divisor, also called GCF) is the largest number that divides evenly into every number you entered. The LCM (Least Common Multiple) is the smallest number that all your numbers divide evenly into. GCD is often used for simplifying fractions, while LCM is used for finding common denominators or scheduling repeating events.

How is the GCD calculated here?

The tool uses the Euclidean algorithm, applied iteratively across your whole list of numbers. For two numbers, it repeatedly replaces the larger number with the remainder of dividing it by the smaller, until the remainder is zero — the last non-zero value is the GCD. For three or more numbers, it finds the GCD of the first two, then combines that result with each remaining number.

How is the LCM calculated?

Once the GCD of two numbers is known, the LCM is found with the formula LCM(a,b) = (a × b) ÷ GCD(a,b). Just like the GCD, this is applied iteratively across your full list, so it works correctly for any amount of numbers, not just two.

Is this tool free and safe to use?

Yes — 100% free, no signup, and no data ever leaves your browser. It's perfect for students double-checking homework, teachers preparing worksheets, or anyone who needs a fast, reliable GCD/LCM answer without doing long division by hand.

Related Tools