GCD & LCM Calculator

Enter two or more whole numbers to get their greatest common divisor (also called highest common factor) and least common multiple, plus the prime factors of each number.

  • Free
  • No sign-up
  • Runs in your browser

Enter your values above to see the result.

How to use GCD & LCM Calculator

  1. Type your whole numbers, separated by commas, spaces or new lines.
  2. Read the GCD and the LCM.
  3. The table shows the prime factors of each number.

About this tool

The GCD is the largest whole number that divides every number in the list. It is found with the Euclidean algorithm and is used to simplify fractions. The LCM is the smallest number that every number divides into, used to find common denominators. For two numbers, GCD × LCM equals their product.

Example: 12 and 18 have GCD 6 and LCM 36. Only whole numbers from 1 to 1,000,000,000,000 are accepted.

Privacy: This tool runs in your browser. What you type or choose is not sent to a server by this website.

Common questions

Is GCD the same as HCF?

Yes. Highest common factor (HCF) and greatest common divisor (GCD) are two names for the same thing.

What if the numbers share no factors?

Then the GCD is 1 and the numbers are called coprime.