Skip to main content

Online Calculators and Tools | Calculators Toolbox

GCF Calculator

Home / GCF Calculator
GCF Calculator illustration showing two groups of colorful blocks being sorted into identical equal stacks, with a magnifying glass highlighting the shared block size

This GCF calculator finds the greatest common factor (HCF/GCD) of two or more numbers, with every step shown.

GCF Calculator

Calculation Explanation

Free tool by GCF Calculator – CalculatorsToolbox

GCF Calculator – Greatest Common Factor (HCF / GCD)

Our free GCF calculator finds the greatest common factor of two or more whole numbers in an instant. It shows the Euclidean algorithm step by step for two numbers, prime factorizations for longer lists, and the LCM as a bonus.

What Is the Greatest Common Factor?

A factor is a whole number that divides another exactly, with nothing left over. The factors of 12 are 1, 2, 3, 4, 6 and 12; the factors of 18 are 1, 2, 3, 6, 9 and 18. The numbers on both lists (1, 2, 3 and 6) are the common factors, and the largest of them, 6, is the greatest common factor.

You'll see the same idea under several names. Americans usually say GCF, British and Indian textbooks use HCF (highest common factor), and mathematicians and programmers call it GCD (greatest common divisor). They all mean exactly the same thing, and this GCF calculator works for all of them.

How to Calculate the GCF

The fastest method for two numbers is the Euclidean algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller one.

GCF(a, b) = GCF(b, a mod b)   → repeat until the remainder is 0

For 180 and 48: 180 = 48 × 3 + 36, then 48 = 36 × 1 + 12, then 36 = 12 × 3 + 0. The last non-zero remainder, 12, is the GCF. Three short divisions instead of listing dozens of factors.

Example Calculations:

GCF of 12 and 18Common factors 1, 2, 3, 6 → 6
GCF of 48 and 180Euclid: 36 → 12 → 0 → 12
GCF of 24, 36 and 602² × 3 = 12
GCF of 17 and 40No shared factor except 1 → 1

How to Use the GCF Calculator

  1. Enter two or more positive whole numbers, separated by commas or spaces.
  2. The greatest common factor appears immediately, together with the least common multiple.
  3. With exactly two numbers, the explanation box walks through the Euclidean algorithm. With three or more, it lists each prime factorization.
  4. If the GCF is 1, the calculator tells you the numbers are coprime, meaning they share no common factor.

Real-World Applications of the GCF

Simplifying Fractions

Divide the top and bottom of 84/126 by their GCF, 42, to get 2/3 in one step.

Making Equal Packs

With 48 pencils and 36 erasers, the largest number of identical kits is GCF(48, 36) = 12, each with 4 pencils and 3 erasers.

Tiling a Floor

The largest square tile that fits a 120 × 84 inch room exactly has sides of GCF(120, 84) = 12 inches.

Splitting Into Groups

A class of 24 boys and 30 girls forms 6 equal mixed teams, each with 4 boys and 5 girls.

Reducing Ratios

The ratio 45 : 60 simplifies to 3 : 4 by dividing both terms by their GCF of 15.

Cryptography

RSA encryption relies on the Euclidean algorithm to check that key numbers are coprime.

Methods for Finding the GCF

Listing Factors

Write every factor of each number and pick the largest one they share. It's easy to understand and fine for small numbers.

Example: 16: 1, 2, 4, 8, 16 · 24: 1, 2, 3, 4, 6, 8, 12, 24 → GCF = 8.

Prime Factorization

Break each number into primes and multiply only the primes they all share, using the lowest power of each.

Example: 60 = 2² × 3 × 5, 90 = 2 × 3² × 5 → 2 × 3 × 5 = 30.

Euclidean Algorithm

Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder. When the remainder reaches 0, the last divisor is the GCF. It's the quickest method for big numbers.

Example: 252, 105 → 42 → 21 → 0. GCF = 21.

Using the LCM

For two numbers, GCF = (a × b) ÷ LCM. If you already know the LCM from the LCM calculator, this is a one-line calculation.

Example: (12 × 18) ÷ 36 = 6.

Tips for Finding the GCF

  • The GCF can never be larger than the smallest number in your list.
  • If the smallest number divides all the others, it is the GCF: GCF(7, 21, 35) = 7.
  • Two different prime numbers always have a GCF of 1.
  • Consecutive whole numbers, like 15 and 16, are always coprime.
  • If all your numbers are even, the GCF is at least 2; if they all end in 0 or 5, it's at least 5.
  • For three or more numbers, find the GCF of the first two, then the GCF of that result with the next number.

GCF Reference Table

NumbersCommon factorsGCFLCM
8, 121, 2, 4424
15, 251, 5575
18, 271, 3, 9954
24, 361, 2, 3, 4, 6, 121272
42, 561, 2, 7, 1414168
35, 64112,240
48, 1801, 2, 3, 4, 6, 1212720
24, 36, 601, 2, 3, 4, 6, 1212360

Step-by-Step Worked Example

A florist has 72 roses and 54 tulips and wants to make identical bouquets with nothing left over. What's the greatest number of bouquets she can make?

  1. Divide the larger number by the smaller: 72 = 54 × 1 + 18.
  2. Divide the previous divisor by the remainder: 54 = 18 × 3 + 0.
  3. The remainder is 0, so the last divisor, 18, is the GCF.
  4. Each of the 18 bouquets gets 72 ÷ 18 = 4 roses and 54 ÷ 18 = 3 tulips.

Enter 72, 54 into the GCF calculator to see these exact steps in the explanation box.

Why the Euclidean Algorithm Works

The method, described by the Greek mathematician Euclid around 300 BCE, rests on one simple fact: any number that divides both a and b also divides their difference, and therefore the remainder when a is divided by b. So GCF(a, b) is the same as GCF(b, remainder), and the numbers shrink with every step. It's one of the oldest algorithms still in everyday use, running inside calculators, computer algebra systems and encryption software around the world.

GCF vs. LCM: Which One Do I Need?

A quick way to decide: if the problem is about splitting things into the largest equal groups or cutting into the biggest identical pieces, you need the GCF. If it's about events happening together again or finding the smallest amount that works for everyone, you need the LCM. Splitting 48 pencils and 36 erasers into kits is a GCF problem; working out when two buses next leave at the same time is an LCM problem.

Why Use Our GCF Calculator?

Our GCF calculator handles two numbers or a long list, shows the Euclidean algorithm or prime factorization so you can follow the logic, flags coprime numbers, and gives the LCM at the same time. It's quick, free and works on any device, so it suits fraction homework, ratio problems and anyone who needs the greatest common factor without the guesswork.

Frequently Asked Questions

Quick answers to common questions related to GCF Calculator are as under:-

What is the greatest common factor?

The greatest common factor is the largest whole number that divides every number in a set without a remainder. The GCF of 12 and 18 is 6.

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 value.

How do you find the GCF of two numbers quickly?

Use the Euclidean algorithm. Divide the larger number by the smaller, replace the larger with the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.

What does it mean if the GCF is 1?

It means the numbers are coprime, or relatively prime. They share no common factor other than 1, like 8 and 15.

How do I find the GCF of three or more numbers?

Find the GCF of the first two numbers, then find the GCF of that result and the next number, and so on. The GCF calculator accepts any number of values at once.

How is the GCF used to simplify fractions?

Divide both the numerator and the denominator by their GCF. For 30/45, the GCF is 15, so the fraction simplifies to 2/3.

Latest from Our Blog

Explore helpful tips, updates, and guides on calculators, AI tools, and conversions.