Toolverge

GCD and LCM Calculator

The greatest common divisor (GCD) is the largest integer that divides every number in a list with no remainder, and the least common multiple (LCM) is the smallest positive integer that every number in the list divides into evenly. Toolverge computes both from a comma or space separated list of two or more integers using the Euclidean algorithm, the same repeated-remainder method taught in school, which also works cleanly across three or more numbers by reducing pairwise.

GCD / LCM

GCD 6 · LCM 72

12, 18, 24

  • gcd(12, 18) = 6
  • gcd(6, 24) = 6

How it works

  1. Enter two or more integers, separated by commas or spaces.
  2. The Euclidean algorithm reduces the GCD across the list, one pair at a time.
  3. LCM is derived from GCD for each pair. Nothing is sent to a server.

Formula gcd(a,b) via Euclidean algorithm; lcm(a,b) = |a×b| / gcd(a,b)

Frequently asked questions

What is the GCD of 12 and 18?

The greatest common divisor of 12 and 18 is 6.

What is the LCM of 4 and 6?

The least common multiple of 4 and 6 is 12.

Can I find the GCD or LCM of more than two numbers?

Yes. Enter three or more integers separated by commas or spaces; the calculator reduces the GCD and LCM across the whole list.

Does the sign of a number matter?

No. GCD and LCM are conventionally non-negative, so negative inputs are treated by their absolute value.

How does the Euclidean algorithm work?

It repeatedly replaces the larger number with the remainder of dividing it by the smaller number until the remainder is zero; the last non-zero value is the GCD.