GCF and LCM calculator

Find exact greatest common factors and least common multiples of integers.

2–100 integers, up to 100 digits each; separate with spaces, commas, or newlines. Signs are ignored. GCF(0,0) = 0; any zero gives LCM 0. Intermediate LCM is limited to 1,000 digits.

YOUR ANSWER

Greatest common factor

6

Least common multiple
72
Count
3
How it’s calculatedCalculated on your device

GCF uses Euclid’s algorithm on absolute integers. LCM(a, b) = |a ÷ GCF(a, b) × b|; any zero gives LCM 0.

Displayed values may be rounded. Calculations keep the underlying precision.

2–100 integers, at most 100 digits each and 15,000 input characters. Negative signs are ignored. GCF of all zeros is 0; any zero makes LCM 0. The intermediate LCM is limited to 1,000 digits.

The formula, made simple

Enter integers to compute their greatest common factor and least common multiple without a floating-point precision limit.

Euclid’s algorithm computes the GCF. LCM(a,b) = |a / GCF(a,b) × b|, with zero handled separately.

A worked example

For 12, 18 and 24, GCF = 6 and LCM = 72.

A few useful answers

Is GCD different from GCF?

They name the same result: greatest common divisor and greatest common factor. Outputs are nonnegative.

Back to calculator ↑