GCD & LCM Calculator

Find the greatest common divisor and the lowest common multiple of two or more whole numbers, with the prime factorisation of each input shown.

Two or more positive integers, separated by commas or spaces.

Fill in the fields above and select Calculate to see your result and the full working.

Formula used

GCD via the Euclidean algorithm; LCM(a, b) = a × b ÷ GCD(a, b)

How to use this calculator

  1. Enter two or more positive whole numbers.
  2. Decimals are rounded and negatives treated as positive.
  3. Prime factorisations are shown for the first few values so you can check the result by hand.

Example calculation

For 24, 36 and 60:

24 = 2³ × 3, 36 = 2² × 3², 60 = 2² × 3 × 5

Common factors: 2² × 3 = 12 → GCD = 12

Highest powers: 2³ × 3² × 5 = 360 → LCM = 360.

What does this result mean?

The GCD is the largest number that divides every input exactly — it is what you cancel by when simplifying a fraction. The LCM is the smallest number every input divides into, which is what you need as a common denominator when adding fractions, or to work out when two repeating cycles coincide.

Frequently asked questions

Is HCF the same as GCD?
Yes — highest common factor and greatest common divisor are two names for the same thing.
What if the GCD is 1?
The numbers are coprime: they share no common factor other than 1, and their LCM is simply their product.
Where is LCM used in practice?
Adding fractions, scheduling events that repeat on different cycles, and gear or pulley problems all rely on it.

Related calculators

More in Mathematics

Browse the Mathematics category or the full calculator directory.