How to Find GCF and LCM (With Step-by-Step Examples)

Learn how to find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) using prime factorization, listing, and the ladder method — with worked examples.

The Greatest Common Factor (GCF) of two or more 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 into evenly. For 12 and 18, the GCF is 6 and the LCM is 36. GCF simplifies fractions to lowest terms; LCM finds a common denominator when adding or subtracting fractions.

This guide walks through three reliable methods for finding both — listing, prime factorization, and the ladder (division) method — with worked examples, plus how GCF and LCM connect to fractions and ratios. Skip to a method below, or use the GCF and LCM calculator to check your work instantly, including with more than two numbers.

GCF vs. LCM at a Glance

GCF (Greatest Common Factor)LCM (Least Common Multiple)
What it isLargest number that divides evenly into every number in the setSmallest number that every number in the set divides into evenly
Also calledGreatest Common Divisor (GCD)Lowest Common Multiple
Used forSimplifying fractions to lowest termsFinding a common denominator
12 and 18636
8 and 12424
Relationship (2 numbers)GCF × LCM = a × bLCM = (a × b) ÷ GCF

Method 1: Listing Factors and Multiples

The most intuitive method for small numbers — no formulas required.

Finding GCF by listing

Step 1: List all factors of each number (numbers that divide into it evenly). Step 2: Circle the factors that appear in every list. Step 3: The largest circled number is the GCF.

Example: GCF of 8 and 12

  • Factors of 8: 1, 2, 4, 8
  • Factors of 12: 1, 2, 3, 4, 6, 12
  • Shared factors: 1, 2, 4 → GCF = 4

Finding LCM by listing

Step 1: List several multiples of each number. Step 2: Find the smallest multiple that appears in both lists.

Example: LCM of 8 and 12

  • Multiples of 8: 8, 16, 24, 32, 40…
  • Multiples of 12: 12, 24, 36, 48…
  • Smallest shared multiple: LCM = 24

Listing works well for small numbers but gets slow and error-prone once numbers get into the hundreds — that’s where prime factorization takes over.

Method 2: Prime Factorization

This is the method that scales to any size of number and is what the GCF and LCM calculator shows in its step-by-step breakdown.

Step 1: Break each number down into its prime factors (a prime factor is a prime number that divides evenly into it, like 2, 3, 5, 7, 11…). Step 2: For the GCF, multiply together the primes that are common to every number, using the lowest power each shares. Step 3: For the LCM, multiply together every prime that appears in any number, using the highest power it appears with.

Example: GCF and LCM of 24 and 36

  1. Prime factorize: 24 = 2 × 2 × 2 × 3 = 2³ × 3¹, and 36 = 2 × 2 × 3 × 3 = 2² × 3²
  2. GCF: shared primes at lowest power → 2² × 3¹ = 4 × 3 = 12
  3. LCM: all primes at highest power → 2³ × 3² = 8 × 9 = 72

Example: GCF and LCM of 12, 18, and 30 (three numbers)

The same method extends to any number of values — just compare across all of them at once.

  1. Prime factorize: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5
  2. GCF: the only primes common to all three are 2 and 3, each at the lowest power any number has (2¹, 3¹) → 2 × 3 = 6
  3. LCM: every prime seen anywhere, at its highest power → 2² × 3² × 5¹ = 4 × 9 × 5 = 180

Method 3: The Ladder (Division) Method

A fast, visual shortcut popular in classrooms — especially handy for finding the GCF and LCM of two numbers in one pass.

Step 1: Write the numbers side by side. Step 2: Find a prime number that divides into both, and divide both numbers by it. Write the prime to the left and the quotients below. Step 3: Repeat with the new quotients until they no longer share a common factor. Step 4: The GCF is the product of the primes on the left. The LCM is the product of the primes on the left times the two final quotients.

Example: 12 and 18

  • Divide both by 2: 12 → 6, 18 → 9
  • Divide both by 3: 6 → 2, 9 → 3
  • 2 and 3 share no more common factors, so stop.
  • GCF = 2 × 3 = 6
  • LCM = 2 × 3 × 2 × 3 = 36

The Shortcut Formula (Two Numbers Only)

If you already know the GCF of two numbers, you can skip straight to the LCM:

LCM(a, b) = (a × b) ÷ GCF(a, b)

For 8 and 12: GCF is 4, so LCM = (8 × 12) ÷ 4 = 96 ÷ 4 = 24 — matching the listing method above. This shortcut only works for exactly two numbers; for three or more, use prime factorization.

Why GCF and LCM Matter: Fractions and Ratios

  • Simplifying fractions: Divide the numerator and denominator by their GCF to reduce a fraction to lowest terms. For 18/24, the GCF is 6, so 18/24 = 3/4. Try it yourself with the fraction calculator.
  • Adding/subtracting fractions: Use the LCM of the denominators as the common denominator — it keeps the numbers smaller than just multiplying denominators together. For 1/6 + 1/4, the LCM of 6 and 4 is 12, so the sum is 2/12 + 3/12 = 5/12.
  • Simplifying ratios: A ratio like 18:24 simplifies the same way as a fraction — divide both sides by the GCF to get 3:4. See the ratio calculator for more examples.

Frequently Asked Questions

What is the GCF of two prime numbers? The GCF of two different prime numbers is always 1, since primes have no factors other than 1 and themselves. For example, the GCF of 7 and 13 is 1 — they’re called “relatively prime” or “coprime.”

What is the LCM of two numbers that share no common factors? When two numbers are coprime (GCF = 1), their LCM is simply their product. The LCM of 7 and 13 is 7 × 13 = 91.

Can the GCF ever be larger than the LCM? No. The GCF is always less than or equal to the smaller number, and the LCM is always greater than or equal to the larger number, so the LCM is always greater than or equal to the GCF (they’re only equal when both numbers are identical).

Is GCF the same as GCD? Yes — Greatest Common Factor (GCF) and Greatest Common Divisor (GCD) are two names for the exact same value.

How do you find the GCF and LCM of more than two numbers? Use prime factorization: factor every number, then take the lowest shared power of each common prime for the GCF, and the highest power of every prime that appears anywhere for the LCM (as shown in the 12, 18, and 30 example above). The GCF and LCM calculator handles any number of values automatically.

The Bottom Line

GCF and LCM both come from the same building block — prime factorization — just combined differently: the lowest shared powers give you the GCF, and the highest powers across every number give you the LCM. Listing works for quick mental math with small numbers, the ladder method is a fast classroom shortcut for two numbers, and prime factorization is the one method that reliably scales to any size or any number of values. Enter your own numbers into the GCF and LCM calculator to see the full prime factorization and step-by-step work, then put it to use simplifying fractions with the fraction calculator or ratios with the ratio calculator.

Advertisement
Advertisement