GCD & LCM Calculator
Find the greatest common divisor and least common multiple of any list of integers instantly — runs 100% in your browser with no upload.
Numbers used: 12, 18, 24
6
72
🔒 Calculated in your browser — nothing is uploaded.
What this GCD & LCM calculator does
Enter two or more whole numbers separated by commas or spaces and this tool instantly shows their greatest common divisor (GCD, also called the highest common factor) and their least common multiple (LCM). The GCD is the largest integer that divides every number in your list without a remainder, while the LCM is the smallest positive integer that every number divides into evenly. Negative signs are ignored and non-integer or empty tokens are skipped, so you can paste messy data and still get a clean answer.
How the results are computed
The GCD is found with the classic Euclidean algorithm, repeatedly replacing the larger value with the remainder of the two until one becomes zero. The LCM of a pair is derived from that GCD using the identity lcm(a, b) = |a × b| / gcd(a, b), and the tool folds this across your whole list. If any number is zero, the LCM is reported as zero, which matches the mathematical convention. Everything updates live as you type.
Frequently asked questions
How do I enter more than two numbers?
Type all your integers on one line separated by commas, spaces, or both — for example "12, 18, 24". The calculator reduces the whole list to a single GCD and a single LCM.
Is anything I type uploaded to a server?
No. The entire calculation runs in your browser using JavaScript. Nothing you enter is sent, stored, or logged anywhere.
What happens if I include zero or a decimal?
Zero is allowed and makes the LCM zero, following the usual convention. Decimals, fractions, and other non-integer tokens are ignored so only whole numbers count toward the result.