How-to guides · 5 min read

How to Find the GCF and LCM: Three Methods With Examples

How to Find the GCF and LCM: Three Methods With Examples — illustration
In short: The greatest common factor (GCF) of 84 and 126 is 42 and their least common multiple (LCM) is 252. This guide shows three reliable ways to get there and when each one is best.

What GCF and LCM mean

The greatest common factor of two numbers is the largest whole number that divides both without a remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). The least common multiple is the smallest positive number that both numbers divide into evenly.

They are useful in everyday maths. The GCF reduces fractions to lowest terms, and the LCM gives the common denominator for adding fractions and tells you when two repeating events line up again.

Method 1: list the factors or multiples

For small numbers, list every factor of each, then pick the largest one they share. For 12 and 18:

NumberFactors
121, 2, 3, 4, 6, 12
181, 2, 3, 6, 9, 18

The common factors are 1, 2, 3 and 6, so the GCF is 6. For the LCM, list multiples instead: 12, 24, 36, 48 and 18, 36, 54. The first number in both lists is 36. Listing is easy to understand but slow for large numbers, so it is best for numbers under about 30.

Method 2: prime factorization

Break each number into primes. The GCF multiplies the primes the numbers share, using the smaller power of each. The LCM multiplies all primes that appear, using the larger power of each. If you need help splitting numbers, use the prime factorization calculator.

NumberPrime factorization
842² × 3 × 7
1262 × 3² × 7
  • GCF: smaller powers of the shared primes: 2¹ × 3¹ × 7¹ = 42.
  • LCM: larger powers of all primes: 2² × 3² × 7¹ = 252.
GCF of 84 and 126 from the shared prime factors
Answer42
Order-of-operations steps 2 steps

Start: 2 × 3 × 7

  1. Multiply
    2 × 3 = 6→ 6 × 7
  2. Multiply
    6 × 7 = 42→ 42

This method scales to three or more numbers, and it makes it clear why the answers work.

Method 3: the Euclidean algorithm

For large numbers, factoring is slow. The Euclidean algorithm finds the GCF by repeated division: divide the larger number by the smaller, replace the larger with the smaller and the smaller with the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.

StepDivisionRemainder
1126 = 1 × 84 + 4242
284 = 2 × 42 + 00

The last non-zero remainder is 42, which matches the prime factorization method. The algorithm is over two thousand years old, appears in Euclid’s Elements, and is still the standard way computers find a GCD because it needs only division.

Getting the LCM from the GCF

Once you have the GCF, the LCM follows from one identity: LCM(a, b) = a × b ÷ GCF(a, b).

LCM of 84 and 126 using the GCF
Answer252
Order-of-operations steps 2 steps

Start: 84 × 126 ÷ 42

  1. Multiply
    84 × 126 = 10584→ 10584 ÷ 42
  2. Divide
    10584 ÷ 42 = 252→ 252

You get 252, the same as before. This only works for two numbers at a time; for three, find the LCM of the first two and then of that result with the third.

Which method to use

SituationBest method
Small numbers, teaching the ideaList factors or multiples
Medium numbers, three or more of themPrime factorization
Large numbers or codeEuclidean algorithm
012.52537.5501248, 1804284, 12630210, 330211071, 462
GCF of sample pairs: GCF(48, 180) = 12; GCF(84, 126) = 42; GCF(210, 330) = 30; GCF(1071, 462) = 21.

Any of the three will give the same answer, so check one against another when accuracy matters. Try your own numbers in the LCM and GCF calculator, which shows the working, then simplify a fraction with the simplify fractions calculator.

Worked practice: simplify and add fractions

Simplify 84/126. The GCF is 42, so divide numerator and denominator by 42: 84 ÷ 42 = 2 and 126 ÷ 42 = 3, giving 2/3.

Add 5/12 + 7/18. The LCM of 12 and 18 is 36. Convert: 5/12 = 15/36 and 7/18 = 14/36. Add the numerators: 29/36. The GCF of 29 and 36 is 1, so it is already in lowest terms.

Using the LCM keeps the numbers as small as possible. Multiplying the denominators gives 216 here, which works but needs an extra simplification step at the end.

Real uses of GCF and LCM

  • Simplifying fractions: 84/126 reduces by dividing both by 42 to give 2/3.
  • Adding fractions: the LCM of the denominators is the smallest common denominator. See how to multiply and divide fractions for related steps.
  • Scheduling: two buses that leave every 12 and 18 minutes leave together again after 36 minutes, the LCM.
  • Splitting into equal groups: the GCF tells you the largest number of identical groups you can make from two collections.

Frequently asked questions

What is the GCF of two prime numbers?

It is 1, because two different primes share no factor other than 1.

Is GCD the same as GCF?

Yes. GCD (greatest common divisor), GCF (greatest common factor) and HCF (highest common factor) all name the same value.

What if one number is a multiple of the other?

The GCF is the smaller number and the LCM is the larger number.

Can I find the GCF of three numbers?

Yes. Find the GCF of two of them, then find the GCF of that result and the third number.

Written and reviewed by Mateuss M.

Mateuss M. writes and reviews mathematical content for CalcSolver, focusing on online calculators, formulas, equations, and practical math tools. He reviews calculator functionality, calculation methods, formulas, examples, and explanations to help ensure that each tool is clear, useful, and easy to understand.

Keep reading