MultiSwitch MultiSwitch
SEARCH
SEARCH
Converters Tools Currency Feedback

GCD & LCM Calculator

Find the greatest common divisor and least common multiple

Enter two or more whole numbers, separated by commas.

—
Greatest Common Divisor (GCD)
—
Least Common Multiple (LCM)
How this works: GCD is found with the Euclidean algorithm (repeated remainder division); LCM(a,b) = |a × b| ÷ GCD(a,b), extended across all numbers entered.

GCD and LCM in plain terms

The greatest common divisor (GCD), also called the highest common factor (HCF), is the largest whole number that divides every number in your list with no remainder. The least common multiple (LCM) is the smallest positive number that every number in your list divides into evenly.

The GCD is what you use to simplify things, such as reducing a fraction or splitting items into equal groups. The LCM is what you use to line things up, such as finding a common denominator or working out when two repeating schedules coincide.

How the calculator works it out

The GCD uses the Euclidean algorithm: divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and that remainder until the remainder is 0. The last non-zero remainder is the GCD. This is fast even for very large numbers.

The LCM then follows from LCM(a, b) = |a × b| ÷ GCD(a, b). For more than two numbers, both are applied in pairs: the GCD of the first two is combined with the third, and so on.

Worked example: 24 and 36

  • 36 ÷ 24 = 1, remainder 12
  • 24 ÷ 12 = 2, remainder 0 → GCD = 12
  • LCM = (24 × 36) ÷ 12 = 864 ÷ 12 = 72

So 24/36 simplifies to 2/3 (divide both by 12). If one bus comes every 24 minutes and another every 36, they leave together again every 72 minutes.

FAQ

Is GCD the same as HCF or GCF?

Yes. Greatest common divisor (GCD), highest common factor (HCF) and greatest common factor (GCF) are three names for the same thing. Which one you meet depends on the country and textbook.

What does it mean if the GCD is 1?

The numbers are coprime: they share no factor other than 1. Their LCM is simply their product, and a fraction made from them is already in lowest terms.

Can I use negative numbers or zero?

GCD and LCM are normally defined for positive whole numbers. Signs are ignored, and the GCD of any number and 0 is that number. The LCM involving 0 is 0, which is rarely useful, so stick to positive integers.

How is this related to prime factorization?

The GCD multiplies the primes the numbers share, each at its lowest power. The LCM multiplies every prime that appears, each at its highest power. The Prime Factor Calculator shows those breakdowns.