GCF calculator

Find the greatest common factor and least common multiple of two numbers.

Last updated: November 2026 · Free estimates, no sign-up

What a GCF calculator does

The greatest common factor (GCF) of two numbers is the largest whole number that divides both of them exactly. It is also called the greatest common divisor (GCD) or the highest common factor (HCF). This calculator finds the GCF of two numbers, then gives you their least common multiple (LCM) and the simplified ratio between them.

How to use this GCF calculator

  1. Enter the first whole number.
  2. Enter the second whole number.
  3. Press Calculate to see the GCF, the LCM and the simplified ratio.

Three ways to find the GCF

1. List the factors. Write all the factors of each number and pick the largest one that appears in both lists. This works well for small numbers.

2. Prime factorisation. Break each number into primes and multiply the primes they share. For 24 = 2 × 2 × 2 × 3 and 36 = 2 × 2 × 3 × 3, the shared primes are 2 × 2 × 3 = 12.

3. The Euclidean algorithm. Replace the larger number with the remainder after dividing by the smaller, and repeat until the remainder is 0. This is the fastest method for big numbers and the one the calculator uses.

GCF(a, b) = GCF(b, a mod b)

Worked example

Find the GCF of 24 and 36. 36 mod 24 = 12, then 24 mod 12 = 0, so the GCF is 12. The LCM is 24 × 36 ÷ 12 = 72. The simplified ratio is 2 : 3.

GCF and LCM of common pairs

NumbersGCFLCM
12 and 18636
8 and 12424
20 and 301060
45 and 6015180
48 and 18012720

Notice that GCF × LCM always equals the product of the two numbers.

GCF vs LCM

The GCF is the largest number that divides both numbers. The LCM is the smallest number that both numbers divide into. Use the GCF to split things into equal groups or simplify fractions. Use the LCM to find a common denominator or to see when two repeating events line up.

Using the GCF to simplify fractions

To simplify 24/36, divide the top and bottom by their GCF, 12. The fraction becomes 2/3. A fraction is in lowest terms when the GCF of the numerator and denominator is 1.

Real-life uses

  • Cutting two lengths of ribbon into equal pieces with no waste.
  • Arranging items into the largest equal groups, such as 24 pens and 36 pencils into 12 identical packs.
  • Tiling a floor with the largest square tile that fits both dimensions.

Common mistakes

People often confuse the GCF with the LCM, or stop at a common factor that is not the greatest one. Check your answer by dividing both numbers: each should divide evenly. If the GCF is 1, the numbers are called coprime.

Frequently asked questions

The largest number that divides both exactly.

Yes, they are different names for the same value.

Multiply the two numbers and divide by their GCF.

The numbers are coprime.

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

No. It can be at most the smaller number.

Divide the numerator and denominator by their GCF.

GCF(a, 0) equals a.

1, unless they are the same prime.

A factor divides a number. A multiple is the result of multiplying it.

Related articles

Related calculators

Note

This calculator gives estimates for general use. It is not financial or medical advice.

GCF calculator

Enter your numbers, then press Calculate.