LCM & GCF Calculator

Calculate the Least Common Multiple (LCM) and Greatest Common Factor (GCF) of up to 10 numbers at once. Full prime factorization working is shown — the method taught in school — so you can see exactly how the answer is derived.

Enter 2–10 positive integers separated by commas
Enter numbers above to calculate LCM and GCF

How It Works

LCM (Least Common Multiple) is the smallest number that is a multiple of all input numbers.
GCF (Greatest Common Factor), also called GCD or HCF, is the largest number that divides evenly into all input numbers.

Method — Prime Factorization:

Step 1: Find the prime factorization of each number.
Example: 12 = 2² × 3¹ and 18 = 2¹ × 3²

Step 2 — GCF: Take the MINIMUM exponent for each common prime factor.
GCF(12, 18): common primes are 2 and 3
GCF = 2^min(2,1) × 3^min(1,2) = 2¹ × 3¹ = 6

Step 3 — LCM: Take the MAXIMUM exponent for each prime factor (from either number).
LCM = 2^max(2,1) × 3^max(1,2) = 2² × 3² = 4 × 9 = 36

Verification: LCM = 12 × 18 ÷ GCF = 216 ÷ 6 = 36 ✓

For multiple numbers, extend the same rule: take min exponents for GCF and max exponents for LCM across all numbers.

Frequently Asked Questions

What is the difference between LCM and GCF?

GCF (Greatest Common Factor) is the largest number that divides ALL your numbers evenly — it goes INTO each number. LCM (Least Common Multiple) is the smallest number that ALL your numbers divide into evenly — each number goes INTO the LCM.

When do I need LCM?

LCM is essential for adding and subtracting fractions (finding a common denominator), scheduling repeating events (when two events with different cycles next coincide), and many number theory problems.

When do I need GCF?

GCF is used to simplify fractions (divide numerator and denominator by GCF), to split things into equal groups, and as the key step in reducing ratios.

What is the Euclidean algorithm?

The Euclidean algorithm efficiently computes GCF: GCF(a, b) = GCF(b, a mod b), repeating until the remainder is 0. For example: GCF(48, 18) → GCF(18, 12) → GCF(12, 6) → GCF(6, 0) = 6. This is much faster than factorization for large numbers.

Can I enter more than two numbers?

Yes, up to 10 numbers comma-separated. The calculator extends GCF and LCM across all numbers: GCF of three numbers is GCF(GCF(a,b), c), and similarly for LCM.