GCD (Greatest Common Divisor) is the largest positive integer that divides all numbers in the set without a remainder. For example, GCD(12, 18) = 6.
GCD & LCM Calculator
Calculate the Greatest Common Divisor and Least Common Multiple of up to 10 integers.
GCD and LCM with prime factorization and Euclidean algorithm.
The Greatest Common Divisor (GCD) is the largest integer that divides all given numbers without a remainder. The Least Common Multiple (LCM) is the smallest positive integer that is a multiple of all of them. The tool uses the iterative Euclidean algorithm and displays the prime factorization of each input.
Enter two or more positive integers.
- Type at least two positive integers in the fields.
- Add more numbers using 'Add number' (up to 10 total).
- Check the GCD, LCM, and optionally the prime factorization of each number.
Sources and references for this tool
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
- Euclid's Elements — Book VII, Proposition 2Euclid / D. E. Joyce — Original Euclidean algorithm for GCD — in use for over 2300 years.
- Knuth — The Art of Computer Programming Vol. 2Donald E. Knuth — Analysis of the Euclidean algorithm and variants in computing.
- BigIntMDN Web Docs — API used for GCD/LCM of large integers without overflow.