Numbers and measurement
GCD and LCM calculator
Calculate the greatest common divisor and least common multiple of up to 50 integers with exact large-integer arithmetic.
Runs in your browser. Inputs stay on this page and are not uploaded or added to the URL.
Your result
How to use this tool
Enter integers to calculate their greatest common divisor and least common multiple. The Euclidean algorithm and exact BigInt arithmetic preserve whole-number precision even beyond JavaScript’s ordinary safe-integer range.
Negative inputs use their absolute values for the result. If any value is zero, the LCM is zero. This tool reports GCD(0, 0) as zero by convention; it does not accept fractions or decimal notation.
Worked example
For 12, 18 and 30, the GCD is 6 and the LCM is 180.
References and method
Contifield is an independent utility site. Reference publishers do not endorse this tool.
Related tools
Ratio simplifier
Reduce two integer or finite-decimal values to an exact whole-number ratio using greatest-common-divisor arithmetic.
DPI and print size calculator
Convert image pixel dimensions to print dimensions, or calculate required pixels from print size and pixels per inch.
Aspect ratio and resize calculator
Simplify a width-to-height ratio and calculate a matching width or height for proportional resizing without cropping.