About this tool
GCD and LCM Calculator finds the greatest common divisor and the least common multiple of a list of integers. Type the numbers separated by commas, spaces or new lines and two tiles show the GCD, the largest number that divides all of them, and the LCM, the smallest positive number that all of them divide. The starting list 12, 18, 24 gives a GCD of 6 and an LCM of 72.
The tool reads every whole number in the text (an optional minus sign followed by digits), so any separator works. This also means that decimals are not understood: 3.5 is read as the two integers 3 and 5, and a hyphen before a digit is read as a minus sign. At least two integers are needed. Calculations use BigInt and the Euclidean algorithm, so large integers stay exact, with no rounding, and there is no fixed limit on how many numbers you can include. For several numbers, the GCD and LCM are built up by combining them pair by pair.
Negative numbers are treated by their absolute value, so the results are never negative. If any number is zero, the LCM is reported as 0 and the GCD ignores the zero. Use the GCD to simplify fractions and the LCM to find a common denominator or a repeating schedule. Everything runs in your browser and nothing is uploaded.