Ithy

GCD and LCM calculator for a list of integers

Calculate the greatest common divisor and least common multiple of 2–50 integers. Negative signs are ignored for divisibility, while zero is handled using explicit conventional rules. Exact integer arithmetic preserves long values.

Free to use, with no sign-in. Inputs and results stay in this page and are not sent with the form. Download a result before leaving; this tool does not save your work.

Enter your values

Worked result

GCD 6; LCM 360.

  1. Use repeated remainders to find common divisors.
  2. Accumulate the greatest common divisor across the list.
  3. Accumulate least common multiples using division before multiplication.

Find the GCD and LCM of 18, 24 and 30

First combine 18 with 24, then combine that result with 30. The pairwise method extends to a longer list.

gcd(18, 24) = 6
gcd(6, 30) = 6
lcm(18, 24) = 18/6 × 24 = 72
gcd(72, 30) = 6
lcm(72, 30) = 72/6 × 30 = 360

The GCD divides every supplied integer. Every nonzero supplied integer divides the LCM. These two checks are useful for catching an accidental factor-versus-multiple swap.

Repeated remainders avoid trial factoring

Euclid’s algorithm replaces a pair (a, b) with (b, a mod b) until the second value is zero. The remaining nonnegative value is the greatest common divisor.

For two nonzero integers, their least common multiple is the absolute product divided by the greatest common divisor. Dividing first avoids an unnecessary large intermediate product. The tool combines pairs until it has processed the full list.

gcd(a, b) = gcd(b, a mod b)
lcm(a, b) = |a/gcd(a, b) × b| when both are nonzero
gcd(0, a) = |a|; gcd(0, 0) = 0
lcm(0, a) = 0

Input limits and common mistakes

Enter whole integers only, with at most 256 digits per integer and at most 50 entries. Decimal points and exponents are rejected even when they could represent a whole number.

The tool uses gcd(0, 0) = 0 and a zero least common multiple when any input is zero, following common computational conventions. This convention does not mean zero is a positive common multiple.

Questions about gcd and lcm

Are GCD and GCF the same here?

Yes. “Greatest common factor” and “greatest common divisor” refer to the same nonnegative integer result.

Can a number be negative?

Yes. The calculation uses its absolute magnitude, so gcd(-18, 24) is 6.

How does this help with fractions?

Divide a fraction’s numerator and denominator by their GCD to simplify it. The LCM can provide a least common denominator.

Sources and verification

These references explain the formulas or formats. The worked examples above were created for this tool and checked against independent calculations or format round trips. AI-assisted development does not imply a named human expert review.

Published 2026-10-23. Examples are illustrations, not measurements of a service or claims about search rankings.

Related tools

Fraction arithmetic

Add, subtract, multiply or divide fractions and mixed numbers. See exact simplified results, common denominators and each calculation step.

Compare and order fractions

Compare two or more fractions, decimals and mixed numbers. Order them exactly and see the common-denominator explanation.

Ratio calculator

Simplify two positive decimal quantities to an exact whole-number ratio, then scale that ratio to a new first quantity.

Further reading

All calculators and developer tools · Source-checked guides · How Ithy checks sources