Numbers and measurement

GCD and LCM calculator

Calculate the greatest common divisor and least common multiple of up to 50 integers with exact large-integer arithmetic.

Runs in your browser. Inputs stay on this page and are not uploaded or added to the URL.

Enter 2–50 integers separated by commas or spaces; up to 100 digits each.

How to use this tool

Enter integers to calculate their greatest common divisor and least common multiple. The Euclidean algorithm and exact BigInt arithmetic preserve whole-number precision even beyond JavaScript’s ordinary safe-integer range.

Negative inputs use their absolute values for the result. If any value is zero, the LCM is zero. This tool reports GCD(0, 0) as zero by convention; it does not accept fractions or decimal notation.

Worked example

For 12, 18 and 30, the GCD is 6 and the LCM is 180.

References and method

Contifield is an independent utility site. Reference publishers do not endorse this tool.

Related tools