SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call

How to find the GCF and LCM

By Taimur Hassan SiddiquiPublished 7 October 2026

The greatest common factor (GCF) and least common multiple (LCM) show up when you simplify or add fractions and solve sharing and timing problems. This guide shows prime factorisation and Euclid's algorithm with worked examples.

The short version

  1. Write each number as a product of primes. For example 12 = 2 × 2 × 3.
  2. GCF: multiply the primes that appear in every number, each to its lowest power.
  3. LCM: multiply every prime that appears anywhere, each to its highest power.
  4. Check with a shortcut. For two numbers, GCF × LCM = their product.

Skip the arithmetic. The free GCF & LCM Calculator does this for you, shows the formula and the working with your own numbers, and runs in your browser - nothing you type is uploaded. Also useful: Fraction Calculator.

Open the GCF & LCM Calculator →

Method 1: prime factorisation

Find the GCF and LCM of 8, 12 and 20.

8 = 2³ 12 = 2² × 3 20 = 2² × 5 GCF = 2² = 4 (3 and 5 are not in all three) LCM = 2³ × 3 × 5 = 120

Method 2: Euclid's algorithm (for the GCF)

Divide the larger number by the smaller and keep the remainder. Repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCF.

GCF of 12 and 18 18 = 1 × 12 + 6 12 = 2 × 6 + 0 → GCF = 6

It is much faster than factorising when the numbers are large, such as 1,071 and 462, where 1,071 = 2 × 462 + 147, 462 = 3 × 147 + 21 and 147 = 7 × 21 + 0, so the GCF is 21.

Method 3: listing

List the multiples or factors of each number and look for the first or largest match. For 4 and 6 the multiples are 4, 8, 12 and 6, 12, so the LCM is 12. Listing is fine for small numbers and is how most people first learn it.

The shortcut for two numbers

GCF × LCM = a × b 12 and 18: 6 × 36 = 216 = 12 × 18

So once you have the GCF you can find the LCM as (a × b) ÷ GCF. The shortcut does not extend to three or more numbers.

Where you use them

  • Simplifying fractions: divide top and bottom by the GCF. 18/24 → GCF 6 → 3/4.
  • Adding fractions: the lowest common denominator is the LCM of the denominators.
  • Sharing: the GCF is the largest group size that splits several amounts evenly - 24 pens and 36 pencils make at most 12 identical packs.
  • Repeating events: the LCM is when they line up. Buses every 12 and 18 minutes leave together every 36 minutes.

Frequently asked questions

Are GCF, HCF and GCD the same thing?
Yes. Greatest common factor, highest common factor and greatest common divisor are three names for the same number.
What if the GCF is 1?
Then the numbers are coprime (relatively prime): they share no factor other than 1. Their LCM is simply their product.
Why is zero not allowed?
Every whole number divides 0, so it has no greatest common factor with anything in the usual sense. The calculators ask for positive whole numbers.
Which method should I use?
Prime factorisation for small numbers and for three or more numbers, Euclid's algorithm for finding the GCF of big numbers.
Can I use it for decimals?
Not directly. Turn the decimals into whole numbers first, or use fractions.