GCD and LCM Calculator (GCD · LCM)

Enter numbers to get the GCD, the LCM and the prime factorization right away.

🔒 Your input is never sent to a server.

How to use

Enter 2 to 10 natural numbers separated by commas or spaces and the result appears immediately. Show solution shows the prime factorization and Euclidean algorithm steps.

How they are found
  • Prime factorization: write each number as a product of primes. The GCD multiplies the smaller exponent of each common prime, and the LCM multiplies the larger exponent of every prime.
  • Euclidean algorithm: keep dividing by the remainder of the larger number divided by the smaller one; the divisor when the remainder reaches 0 is the GCD.
  • For two numbers a and b, a × b = (GCD) × (LCM).
FAQ

What does coprime mean?

Two numbers whose GCD is 1. For example, 17 and 31 are coprime.

How large can the numbers be?

The GCD and LCM are computed exactly up to 18 digits. Prime factorization is shown only for numbers up to 10¹⁴ (100 trillion).

Results are for reference only and accuracy is not guaranteed. Terms & disclaimer