Impact-Site-Verification: 1fce05f2-a6cf-4f31-8ca1-aaddc332516c

LCM & GCD Calculator

Greatest common divisor and least common multiple for two or more integers—with running steps.

Multi-number lists
Euclid GCD
Pairwise LCM

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.

Jump to calculator · Sources & review

How to Find LCM and GCD

Paste or type at least two nonzero integers separated by commas, spaces, or semicolons.

1

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

numbersText:12, 18

GCD / LCM

GCD 6, LCM 36

6 divides both; 36 is the least shared multiple.

Three numbers

Integers

numbersText:4, 6, 8

GCD / LCM

GCD 2, LCM 24

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

Yes. Greatest common divisor and highest common factor name the same idea.

Still have questions about this calculation?

Try the Calculator

Euclid and Pairwise LCM

List GCD/LCM reduce pairwise so the same identities work for more than two numbers.

Formula

gcd​(​a, b​)​ ​=​ gcd​(​b, a mod b​)​

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.