Math

LCM & GCF Calculator

Enter a list of whole numbers to find their least common multiple (LCM) and greatest common factor (GCF, also called GCD) at once.

Your numbers

LCM
Enter at least two numbers to calculate.

How the LCM & GCF formula works

GCF is found with the Euclidean algorithm, and LCM is derived from it:

GCF(a,b) = GCF(b, a mod b), until b = 0
LCM(a,b) = (a × b) / GCF(a,b)

For more than two numbers, the calculator applies this pairwise, combining the running result with each additional number in turn.

Step-by-step calculation

  1. Find the GCF of the first two numbers using the Euclidean algorithm (repeated division with remainder).
  2. Use that GCF to compute the LCM of the same two numbers.
  3. If a third number is present, find the GCF and LCM between the running result and that number, and repeat for any further numbers.

Worked example

For 12 and 18: GCF(12,18) = 6, since 6 is the largest number dividing both evenly. LCM(12,18) = (12×18)/6 = 36 — the smallest number both 12 and 18 divide into evenly.

Frequently asked questions

What's GCF used for in practice?

GCF is used to simplify fractions to lowest terms and to factor expressions in algebra — it's the largest number that divides a set of numbers with no remainder.

What's LCM used for in practice?

LCM is most commonly used to find a common denominator when adding or subtracting fractions with different denominators.

Is GCF the same as GCD?

Yes — 'greatest common factor' and 'greatest common divisor' are two names for the identical concept, and calculators and textbooks use the terms interchangeably.