FreeMathCamp
Course Articles

Free Math Camp

A free course in the maths you need before calculus. Short lessons, interactive visuals, practice that adapts to you, and a record of progress on your account.

freemathcamp.app

Made by Adam Richard Turner

hello@adamrichardturner.dev

Course

  • Foundations
  • Articles
  • Start free
  • Sign in

Legal

  • Privacy
  • Terms
  • Do not sell or share

Copyright © Adam Richard Turner. All rights reserved.

  1. Articles
  2. /
  3. Number & Arithmetic
Number & Arithmetic

Greatest Common Factor and Least Common Multiple (GCF and LCM)

How to find the GCF and LCM by listing and by prime factors, a Venn diagram way to see both at once, and where each one turns up: simplifying fractions and finding common denominators.

3 min read Supports 4 lessons
In short

The greatest common factor (GCF, or HCF) of two numbers is the largest number that divides both. The least common multiple (LCM) is the smallest number that both divide into.

Two numbers usually share some factors and some multiples. The GCF is the biggest factor they share. The LCM is the smallest multiple they share. One looks down into the numbers; the other looks up from them.

By listing

For small numbers, listing works well. Take 121212 and 181818.

factors of 12:1,2,3,4,6,12factors of 18:1,2,3,6,9,18\begin{aligned}\text{factors of } 12 &: 1, 2, 3, 4, \mathbf{6}, 12 \\ \text{factors of } 18 &: 1, 2, 3, \mathbf{6}, 9, 18\end{aligned}factors of 12factors of 18​:1,2,3,4,6,12:1,2,3,6,9,18​

The largest shared factor is 666, so gcd⁡(12,18)=6\gcd(12, 18) = 6gcd(12,18)=6.

multiples of 12:12,24,36,48,…multiples of 18:18,36,54,…\begin{aligned}\text{multiples of } 12 &: 12, 24, \mathbf{36}, 48, \dots \\ \text{multiples of } 18 &: 18, \mathbf{36}, 54, \dots\end{aligned}multiples of 12multiples of 18​:12,24,36,48,…:18,36,54,…​

The first shared multiple is 363636, so lcm⁡(12,18)=36\operatorname{lcm}(12, 18) = 36lcm(12,18)=36.

By prime factors

For bigger numbers, write each as a product of primes. Then the GCF takes the primes they share, at the lowest power, and the LCM takes every prime, at the highest power.

  1. 12=22⋅318=2⋅3212 = 2^2 \cdot 3 \qquad 18 = 2 \cdot 3^212=22⋅318=2⋅32

    Write both numbers as prime factorisations.

1/5
Tip

Picture a Venn diagram of prime factors. 121212 has 2,2,32, 2, 32,2,3 and 181818 has 2,3,32, 3, 32,3,3. The overlap holds 2,32, 32,3: multiply those for the GCF. Everything in the diagram, 2,2,3,32, 2, 3, 32,2,3,3, multiplies to the LCM.

A neat check

Product rule
gcd⁡(a,b)×lcm⁡(a,b)=a×b\gcd(a,b) \times \operatorname{lcm}(a,b) = a \times bgcd(a,b)×lcm(a,b)=a×b

For 121212 and 181818: 6×36=216=12×186 \times 36 = 216 = 12 \times 186×36=216=12×18.

This works because the GCF and LCM between them use every prime factor of aaa and bbb exactly once.

Where they are used

The GCF simplifies. Dividing the top and bottom of 1218\frac{12}{18}1812​ by their GCF, 666, gives 23\frac{2}{3}32​ in one step. In algebra, factoring out the GCF is the first move in factorising an expression.

The LCM combines. To add 112+118\frac{1}{12} + \frac{1}{18}121​+181​ you need a common denominator, and the LCM, 363636, is the smallest one.

Worked example

Buses leave a station every 121212 minutes and trains every 181818 minutes. Both leave at 9:00. When do they next leave together?

  1. 1

    They coincide at shared multiples of 121212 and 181818.

Watch out

Do not mix them up. If the answer is smaller than both numbers, it is a factor (GCF). If it is bigger than both, it is a multiple (LCM).

Common 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 is the GCF of two primes?

If the primes are different, their only shared factor is 111, so the GCF is 111 and the LCM is their product.

Practise gcf and lcm

The GCF & LCM lesson has worked examples and unlimited practice that adapts to you.

Open the lesson

On this page

  1. By listing
  2. By prime factors
  3. A neat check
  4. Where they are used
  5. Common questions
Lessons on this
  • GCF & LCMNumber Sense & Arithmetic
  • Equivalent Fractions & SimplifyingFractions
  • Adding & Subtracting FractionsFractions
  • Factoring Out the GCFPolynomials, Quadratics & Rational Functions
Related reading7
Ideas this article builds on or leads to.
  • Number & Arithmetic
    Prime Numbers and Prime Factorisation with Factor Trees

    A prime number has exactly two factors, 111 and itself. Prime factorisation writes a number as a product of primes, such as 360=23×32×5360 = 2^3 \times 3^2 \times 5360=23×32×5.

  • Fractions, Decimals & Percentages
    Equivalent Fractions and Simplifying to Simplest Form

    Equivalent fractions name the same amount with different numbers, like 12=24=48\frac{1}{2} = \frac{2}{4} = \frac{4}{8}21​=42​=84​. Multiplying or dividing the top and bottom by the same number never changes a fraction's value.

  • Fractions, Decimals & Percentages
    Common Denominators: How to Compare, Add and Subtract Fractions

    A common denominator is a denominator shared by two or more fractions. Rewriting fractions over a common denominator makes their pieces the same size, so they can be compared, added and subtracted.

  • Number & Arithmetic
    Factors and Multiples: What Is the Difference?

    A factor of a number divides it exactly, with no remainder. A multiple of a number is that number times a whole number. So 444 is a factor of 121212, and 121212 is a multiple of 444.

  • Powers & Roots
    What Are Exponents? Powers, Bases and Repeated Multiplication

    An exponent (or power) says how many times to multiply a number, the base, by itself: 25=2×2×2×2×2=322^5 = 2 \times 2 \times 2 \times 2 \times 2 = 3225=2×2×2×2×2=32.

  • Polynomials & Quadratics
    How to Factorise Quadratics: Sum-Product Method and Difference of Two Squares

    Factorising a quadratic rewrites it as a product of brackets: x2+7x+12=(x+3)(x+4)x^2 + 7x + 12 = (x + 3)(x + 4)x2+7x+12=(x+3)(x+4). For x2+bx+cx^2 + bx + cx2+bx+c, look for two numbers that add to bbb and multiply to ccc.

  • Algebra
    Algebraic Expressions: Variables, Terms, Coefficients and Like Terms

    An expression combines numbers and variables (letters standing for numbers) with operations, like 3x+53x + 53x+5. Like terms have exactly the same variable part and can be combined by adding their coefficients.