GCF and LCM Calculator

The GCF and LCM calculator finds the greatest common factor and the least common multiple of 2 to 10 whole numbers, with every step shown. It writes each number as a product of primes, draws a factor tree and a Venn diagram, checks the GCF with the Euclidean algorithm, and lists the factors and multiples for small numbers. A second tab finds the least common denominator (LCD) of fractions.

Try:

GCF is the greatest common factor (also called GCD or HCF). LCM is the least common multiple. The LCD of fractions is the LCM of their denominators.

In short: GCF = the primes every number shares, multiplied together (lowest powers). LCM = every prime that appears, multiplied together (highest powers). For 12 and 18: GCF = 6 and LCM = 36.

How to Use the GCF and LCM Calculator

  1. Type your numbers separated by commas or spaces, such as 24, 36 or 8 12 16. You can enter up to 10 whole numbers.
  2. Press Calculate. You get the GCF and the LCM together, plus a Venn diagram (for two numbers) and a factor tree for each number.
  3. Read the steps. They show the prime factorization, the shared primes, the Euclidean check and, for two numbers, that GCF × LCM equals the two numbers multiplied.
  4. For fractions, open the LCD of fractions tab and type fractions such as 1/4, 5/6, 3/8. The calculator finds the least common denominator and rewrites each fraction with it.

What Are the GCF, LCM and LCD?

TermMeaningExample (12 and 18)
GCF (greatest common factor, also GCD or HCF)The largest number that divides into every number exactly6
LCM (least common multiple)The smallest number that every number divides into exactly36
LCD (least common denominator)The LCM of the denominators of some fractions1/12 and 1/18 → LCD 36

Two quick checks: the GCF can never be bigger than the smallest number, and the LCM can never be smaller than the largest number. For any two numbers, GCF × LCM = the two numbers multiplied: 6 × 36 = 216 = 12 × 18.

GCF and LCM calculator showing a Venn diagram of the prime factors of 12 and 18: GCF = 6 and LCM = 36
The shared primes of 12 and 18 (2 and 3) give the GCF 6; all the primes give the LCM 36.

Worked Examples

NumbersPrime factorsGCFLCM
12, 182² × 3 and 2 × 3²636
24, 362³ × 3 and 2² × 3²1272
8, 12, 162³, 2² × 3 and 2⁴448
15, 20, 253 × 5, 2² × 5 and 5²5300
84, 1262² × 3 × 7 and 2 × 3² × 742252
7, 13both prime191

Example: LCD of 1/4, 5/6 and 3/8. The LCM of 4, 6 and 8 is 24, so the LCD is 24: 1/4 = 6/24, 5/6 = 20/24 and 3/8 = 9/24. This is the first step when you add fractions with different denominators.

Learn the Methods

GCF and LCM Calculator: FAQ

What is the GCF of 12 and 18?

The GCF of 12 and 18 is 6. 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3, and the shared primes 2 × 3 make 6.

What is the LCM of 12 and 18?

The LCM of 12 and 18 is 36. Multiply every prime at its highest power: 2² × 3² = 36.

Is GCF the same as GCD and HCF?

Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the same number.

Can the calculator find the GCF and LCM of three or more numbers?

Yes. Enter up to 10 numbers. For 8, 12 and 16 it gives GCF 4 and LCM 48.

How do I find the least common denominator?

The least common denominator is the LCM of the denominators. For 1/4 and 5/6, the LCM of 4 and 6 is 12, so the LCD is 12.

What does it mean if the GCF is 1?

The numbers are relatively prime (coprime): they share no factor except 1. Their LCM is then their product, such as 7 × 13 = 91.

Is the GCF and LCM calculator free?

Yes. It is free, needs no sign-up and runs in your browser.

Sources and Further Reading

Also try the fraction calculator, the equivalent fractions calculator and the scientific calculator.