Greatest Common Factor and Least Common Multiple Calculator

GCF & LCM

GCF: 6 · LCM: 36

Compare Calculations

Downloads

Includes your inputs and results for this calculation, plus any additional calculations you've compared.

How This Calculator Works

The Greatest Common Factor (GCF, also called GCD) of a set of numbers is the largest number that divides evenly into all of them, and the Least Common Multiple (LCM) is the smallest number that all of them divide evenly into. Enter two or more whole numbers, and this calculator finds both instantly.

The Method

GCF is found using the Euclidean algorithm — a method dating back over 2,000 years: repeatedly divide the larger number by the smaller and replace the larger with the remainder, until the remainder reaches zero. The last non-zero value is the GCF.

Once the GCF is known, the LCM of two numbers follows directly:

LCM(a,b)=a×bGCF(a,b)\text{LCM}(\vA{a}, \vB{b}) = \frac{\vA{a} \times \vB{b}}{\vC{\text{GCF}(\vA{a}, \vB{b})}}

For more than two numbers, this calculator applies both methods pairwise across the whole list.

Worked Example

Finding the GCF and LCM of 12 and 18:

  1. Euclidean algorithm: 18 ÷ 12 leaves a remainder of 6; 12 ÷ 6 leaves a remainder of 0. The GCF is 6\vC{6}.
  2. LCM(12,18)=(12×18)÷6=216÷6=36\text{LCM}(\vA{12}, \vB{18}) = (12 \times 18) \div \vC{6} = 216 \div \vC{6} = 36.

Source: Euclidean Algorithm.

Frequently Asked Questions

What is the difference between GCF and LCM?

GCF (Greatest Common Factor, also called GCD) is the largest number that divides evenly into every number in the list. LCM (Least Common Multiple) is the smallest number that every number in the list divides evenly into. GCF is always less than or equal to the smallest input; LCM is always greater than or equal to the largest.

What is GCF/LCM used for?

GCF is commonly used to simplify fractions (dividing both the numerator and denominator by their GCF gives the simplest form). LCM is used to find a common denominator when adding or subtracting fractions with different denominators, and in scheduling problems (e.g. "these two events repeat every 4 and 6 days — when do they next coincide?").

Can I find the GCF/LCM of more than two numbers?

Yes — enter as many whole numbers as you like, separated by commas, spaces, or new lines. This calculator finds the GCF and LCM across the entire list, not just pairs.