GCD & LCM Calculator

Find the GCD and LCM of any set of numbers, with prime factorization shown for each.

Math Calculators Free
Separate positive integers with commas or spaces.
GCD (Greatest Common Divisor)
LCM (Least Common Multiple)

Prime Factorization

About this tool

Greatest common divisor and least common multiple, together

The GCD (also called the greatest common factor, or GCF) is the largest number that divides evenly into every number in your list. The LCM is the smallest number that every number in your list divides into evenly. This calculator finds both at once for any set of two or more positive whole numbers, using the Euclidean algorithm for speed and accuracy even on large numbers.

How to use the GCD and LCM calculator

  • Type two or more positive whole numbers, separated by commas or spaces.
  • Read off the GCD and LCM the moment you finish typing — no submit button needed.
  • Scroll down to see the full prime factorization of each number, which is exactly how the GCD and LCM are derived mathematically.
  • Use "Copy" to grab a plain-text summary of your numbers and results.

Real-world uses

Students use GCD to simplify fractions to lowest terms and LCM to find a common denominator when adding or subtracting fractions. Outside the classroom, LCM shows up any time you need to sync up repeating cycles — like figuring out when two events that repeat every 4 and 6 days will next land on the same day (their LCM: every 12 days). GCD is also the basis of the classic "simplify this ratio" problem in recipes, scaling, and design work.

Frequently asked questions

What's the difference between GCD and GCF?

Nothing — "greatest common divisor" and "greatest common factor" are two names for the exact same value; both refer to the largest number that divides evenly into every number in the set.

How is GCD calculated here?

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 non-zero remainder is the GCD. This is far faster than checking every possible common factor by hand, especially for large numbers.

How is LCM related to GCD?

For any two numbers, LCM(a, b) = (a × b) ÷ GCD(a, b). This calculator extends that relationship across your entire list of numbers, not just two at a time.

Can I enter more than two numbers?

Yes — enter as many positive whole numbers as you like, separated by commas or spaces, and the GCD/LCM are computed across the entire set at once.

Why does prime factorization matter here?

The GCD is the product of the shared prime factors (at their lowest shared power) across all your numbers, and the LCM is the product of every prime factor that appears (at its highest power) across all of them — the factorization breakdown shows exactly why the GCD/LCM come out the way they do.