LCM & GCD Calculator
Parses a list of nonzero integers, computes the greatest common divisor via Euclid’s algorithm, and the least common multiple via pairwise reduction.
Limitation: Nonzero integers only.
How to Find LCM and GCD
Paste or type at least two nonzero integers separated by commas, spaces, or semicolons.
Enter integers such as 12, 18 or 4; 6 8.
Signs are ignored for magnitude
GCD and LCM are reported as positive magnitudes of the absolute values.
GCD vs LCM
GCD is the largest positive integer dividing every input. LCM is the smallest positive integer that is a multiple of every input.
Worked LCM/GCD Examples
Classic pair
Integers
GCD / LCM
6 divides both; 36 is the least shared multiple.
Three numbers
Integers
GCD / LCM
Pairwise reduction: gcd(4,6)=2 then gcd(2,8)=2; lcm(4,6)=12 then lcm(12,8)=24.
Fraction link
After finding gcd(8,12)=4, simplify 8/12 to 2/3 in the fraction calculator.
Frequently Asked Questions
Still have questions about this calculation?
Try the CalculatorEuclid and Pairwise LCM
List GCD/LCM reduce pairwise so the same identities work for more than two numbers.
Formula
Euclidean GCD
gcd(a, b) = gcd(b, a mod b)
Two-number LCM
lcm(a, b) = |a·b| / gcd(a, b)
Identity check
gcd(a, b) · lcm(a, b) = |a·b|
Scientific Background
Assumptions: nonzero integers within ±1e9 and LCM inside the safe integer range. Limitations: zero is rejected because LCM with zero is not useful for this worksheet.
Sources & review
LCM & GCD Calculator documents the references behind its formulas and assumptions. Always treat results as educational estimates, not personalized professional advice.
Last reviewed
July 22, 2026
Free Calculator Hub methodology
Free Calculator Hub
/methodology
See our methodology and corrections policy.