All tools · Calculators

GCD & LCM calculator

Enter numbers separated by commas or spaces to get their GCD, LCM and prime factors.

—GCD
—LCM

Prime factors

How to use

  1. Enter two or more numbers (e.g. 12, 18, 30).
  2. The GCD and LCM appear at once.
  3. The table shows each number's prime factorisation.

Questions

How is it calculated?

The GCD with Euclid's algorithm; the LCM as the product divided by the GCD, pair by pair.

Zero or negative numbers?

The GCD uses absolute values; with a 0 in the list the LCM is 0.

How large can factorisation go?

Up to about 10¹⁴ instantly; larger numbers are not factored. GCD and LCM are exact at any size.

Is my input saved or sent?

No. It is processed in your browser only.

Related tools

All tools