Math / CALCULATOR

GCD & LCM Calculator

Find the greatest common divisor and least common multiple of two to ten integers.

Use the results to simplify fractions, compare repeating cycles or find a shared interval.

Your calculation

Enter your values below.

Enter 2–10 integers separated by commas, spaces or new lines.

Your calculation is not saved.

Use a decimal point. For single values, enter 1500 rather than 1,500.
YOUR RESULT · Calculating…

Ready when
you are.

Enter your values and select Calculate.

Calculated with unrounded values. Display precision follows each result.

THE WORKING

How this calculator works

The Euclidean algorithm finds the GCD without enumerating factors. LCM is built pairwise by dividing out the GCD before multiplying. Signs are ignored. The calculation rejects an LCM above 9,007,199,254,740,991 so its integer result remains safely representable in the response.

The formula

GCD(a,b) = GCD(b,a mod b)
LCM(a,b) = |(a/GCD(a,b)) × b|
If either number is zero, LCM is zero.

A quick example

For 12 and 18, the greatest common divisor is 6 and the least common multiple is 36.

How to use this calculator

  1. Enter 2–10 integers separated by spaces, commas or new lines.
  2. Use plain integers rather than decimal or exponential notation.
  3. Calculate GCD and LCM; reduce input magnitudes if the exact-result limit is exceeded.

A few common questions

Are negative integers allowed?
Yes. Their absolute magnitudes are used.
What happens with zero?
GCD(0,n) is |n| and LCM is zero. For an all-zero list, this tool uses GCD=0 and LCM=0.
Why is an extremely large LCM rejected?
The tool preserves exact integer results rather than returning a silently rounded multiple.

Was this calculator useful?

Report an issue

Recently used