A shared unit
For 48, 180, and 240, the GCD is 12 and the LCM is 720. All three values are divisible by 12, and each divides 720.
Calculate a common divisor and a common multiple for an entire list of integers. Large inputs remain exact, and the accumulation trace shows how each additional value changes the running GCD and LCM.
Calculations run locally in your browser. This tool does not upload the numbers you enter.
Enter 2–30 integers separated by spaces, commas, semicolons, or new lines.
Calculate to see the nonnegative GCD and LCM and a trace after each input.
Review zero and sign conventions before copying or downloading the exact text output.
For 48, 180, and 240, the GCD is 12 and the LCM is 720. All three values are divisible by 12, and each divides 720.
For −18 and 24, the result is GCD 6 and LCM 72. For 0 and 24, the GCD is 24 and the LCM is 0.
The greatest common divisor is found by repeatedly replacing a pair (a, b) with (b, a mod b) until the second value is zero. The last nonzero remainder is the GCD. Absolute values are used so the answer never depends on the sign you typed.
For two nonzero inputs, LCM(a, b) = |(a / GCD(a, b)) × b|. Dividing before multiplying avoids unnecessary intermediate growth. The same pairwise rule extends to a list by combining its values one at a time.
This calculator defines GCD(0, 0) as 0 and sets the LCM to 0 whenever any input is zero. The all-zero GCD is an explicit computational convention; the ordinary largest-positive-divisor description does not choose a finite maximum for that case.
No. GCD and LCM here are defined for integer inputs. Multiply rational values by a suitable common denominator first if that matches your problem.
Greatest common divisor and highest common factor refer to the same positive-integer quantity.
Each integer may contain up to 100 digits, with at most 30 inputs. The output can be longer than any individual input.
The final GCD and LCM do not depend on order. Only the intermediate accumulation trace changes.