Docomint

LCM / GCD Calculator

Find the least common multiple and greatest common divisor of two or more numbers.

🔒 Processed on your device

What is a LCM / GCD Calculator?

GCD (greatest common divisor) is what you need to simplify a fraction to lowest terms; LCM (least common multiple) is what you need to find a common denominator before adding fractions, or to figure out when two repeating events next line up. This handles either one, for two numbers or a longer list at once.

How to use the LCM / GCD Calculator

  1. Enter two or more positive whole numbers, separated by commas
  2. Press Calculate
  3. The GCD and LCM appear instantly, computed on your device using the Euclidean algorithm

Formula

GCD via the Euclidean algorithm (repeated remainder division); LCM = (a × b) ÷ GCD(a, b) for two numbers

For more than two numbers, GCD and LCM are computed pairwise across the whole list rather than just the first two.

Example

For 18, 24, and 30, the GCD is 6 (the largest number that divides all three evenly) and the LCM is 360 (the smallest number all three divide into evenly) — useful for simplifying a three-way ratio or scheduling three events that repeat every 18, 24, and 30 days.

Common mistakes

Frequently asked questions

What's the difference between LCM and GCD?

GCD (greatest common divisor) is the largest number that divides every input evenly — used to simplify fractions and ratios. LCM (least common multiple) is the smallest number that every input divides into evenly — used to find a common denominator or line up repeating events.

How is GCD calculated?

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 nonzero remainder is the GCD. It's far faster than checking every possible divisor by hand.

Can I find GCD/LCM of more than two numbers?

Yes — enter any comma-separated list of two or more numbers and both results are computed across the entire list, not just the first pair.

What is the GCD of two numbers that share no common factor?

1 — such numbers are called coprime. A GCD of 1 doesn't mean there's an error; it means the numbers are already in their simplest relationship to each other.

Is my numbers uploaded anywhere?

No — LCM / GCD Calculator runs entirely in your browser using JavaScript/WebAssembly. Your numbers is never sent to a server.

Related calculators