GCD & LCM Calculator

Paste two or more whole numbers above to see their GCD and LCM.

Calculated locally in your browser. Your input stays only on this page.

Greatest common divisor and least common multiple of a list of integers

Paste integers separated by commas, spaces, tabs, or new lines — a copied spreadsheet column or a CSV row both work, and blank gaps between separators are ignored. As you type, the panel reports the GCD (the largest integer that divides every value) and the LCM (the smallest positive integer every value divides into). A single value echoes its own absolute value, and negative integers are treated by absolute value.

The calculation uses BigInt and the Euclidean algorithm, so arbitrarily large numbers stay exact; the LCM folds across the list as a / gcd(a, b) * b to avoid an oversized intermediate product. By the usual conventions, gcd(0, n) = n and lcm(0, n) = 0. If a token is not a valid integer, an inline message names it instead of dropping it silently or showing NaN. Everything is computed in your browser with no network calls. Fractions, decimals, polynomials, prime factorization, and step-by-step working are out of scope.