LCM & GCF Calculator

Find the Least Common Multiple and Greatest Common Factor with full prime factorization.

Enter Numbers

Results

GCF (Greatest Common Factor)
0
LCM (Least Common Multiple)
0

Numbers vs LCM

Prime Factorization

Number Prime Factorization

How GCF and LCM Are Calculated

The Greatest Common Factor (GCF), also called the Greatest Common Divisor, is the largest number that divides every number in the list without a remainder. The Least Common Multiple (LCM) is the smallest number that all the numbers in the list divide into evenly.

Why GCF takes the lowest power, and LCM the highest

GCF can only use as many copies of a shared prime factor as the number with the fewest has — otherwise it wouldn't divide that number cleanly. LCM needs enough copies of each prime to cover whichever number needs the most — otherwise that number wouldn't divide it evenly. That's why GCF is built from the lowest shared power of each prime, and LCM from the highest.

The shortcut formula for LCM

LCM(a, b) = (a Ɨ b) Ć· GCF(a, b)

Multiplying a Ɨ b counts every shared prime factor twice — once from each number. Dividing by GCF(a, b) removes exactly one of those duplicate copies, leaving each prime factor at its highest needed power, which is the LCM. This avoids factoring both numbers into primes by hand.

Worked example

For the default list 12, 18, 30: their prime factorizations are 12 = 2² Ɨ 3, 18 = 2 Ɨ 3², and 30 = 2 Ɨ 3 Ɨ 5. The GCF takes the lowest power of each shared prime: 2¹ Ɨ 3¹ = 6. The LCM takes the highest power of every prime that appears: 2² Ɨ 3² Ɨ 5¹ = 180.

How to find GCF and LCM, step by step

  1. Enter two or more whole numbers, separated by commas.
  2. Click Calculate to see the Greatest Common Factor (GCF) and Least Common Multiple (LCM).
  3. Check the prime factorization breakdown to see exactly how the GCF and LCM were derived.

Common uses

Frequently Asked Questions

GCF is the largest number that divides every input evenly — so for each shared prime factor, it can only use as many copies as the number with the fewest has, otherwise it wouldn't divide that number cleanly. LCM is the smallest number every input divides into — so it needs enough copies of each prime to cover whichever number needs the most, otherwise that number wouldn't divide it evenly.

Multiplying a Ɨ b counts every shared prime factor twice — once from each number. Dividing by GCF(a, b) removes exactly one of those duplicate copies, leaving each prime factor represented at its highest needed power — which is precisely the definition of the LCM. This shortcut avoids having to factor both numbers into primes by hand.

Both GCF and LCM can be computed pairwise across a longer list: find the GCF (or LCM) of the first two numbers, then combine that result with the third number, and so on until every number in the list has been included. This calculator handles any list length using that same pairwise approach.

A fraction is in its simplest form when its numerator and denominator share no common factor other than 1. Dividing both by their GCF removes every shared factor in one step, which is exactly why fraction simplification uses the GCF of the numerator and denominator — see the Fraction Calculator, which applies this automatically to every result.

LCM answers "when will these repeating things next line up?" — for example, if one bus arrives every 12 minutes and another every 18 minutes, they'll both arrive together every LCM(12, 18) = 36 minutes. The same logic applies to scheduling shifts, blinking lights, or any two cycles that repeat at different intervals.

If two numbers share no common factors other than 1 (they're "coprime"), their GCF is 1, and their LCM is simply the product of the two numbers (since dividing by a GCF of 1 changes nothing in the LCM formula). For example, GCF(8, 15) = 1 and LCM(8, 15) = 120.