Greatest Common Factor Calculator

Find the GCF, GCD, or HCF of any set of numbers with step-by-step solutions.

i Enter integers separated by commas or spaces.
Greatest Common Factor

What Is the Greatest Common Factor (GCF)?

In simple terms, the Greatest Common Factor (GCF) is the largest integer that divides evenly into a set of numbers without leaving a remainder. Think of it as the “biggest building block” that two or more numbers share.

For example, if you look at the numbers 12 and 16:

  • The number 4 divides evenly into 12 (12 / 4 = 3).
  • The number 4 also divides evenly into 16 (16 / 4 = 4).
  • Since there is no number larger than 4 that can divide both perfectly, 4 is the GCF.

Different Names, Same Math

Depending on where you went to school or what textbook you used, you might see this concept referred to by different acronyms. They all calculate the exact same thing:

  • GCD: Greatest Common Divisor (Common in computer science and higher math).
  • HCF: Highest Common Factor (Widely used in the UK, India, and Australia).
  • GCM: Greatest Common Measure.

How to Calculate GCF: 3 Reliable Methods

While the calculator above gives you the answer instantly, understanding the underlying math is useful for students and professionals alike. There are three main ways to find the GCF manually.

Method 1: Listing Factors (The Intuitive Way)

This is the method our calculator uses to show you the step-by-step solution. It is perfect for smaller numbers where you can easily do the mental math.

  1. List all factors for each number.
  2. Identify the common factors that appear in every list.
  3. Pick the largest one.

Example: Find the GCF of 18 and 24

  • Factors of 18: 1, 2, 3, 6, 9, 18
  • Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
  • Common Factors: 1, 2, 3, 6
  • Greatest Common Factor: 6

Method 2: Prime Factorization (The “Factor Tree”)

This method is more reliable for medium-sized numbers because it breaks everything down into basic prime components.

  1. Break each number down into its prime factors (e.g., 2 x 3 x 5).
  2. Circle the prime factors that are present in both lists.
  3. Multiply those shared primes together to get the GCF.

Example: Find the GCF of 20 and 30

  • 20 = 2 x 2 x 5
  • 30 = 2 x 3 x 5
  • Shared Primes: Both have a 2 and a 5.
  • Calculation: 2 x 5 = 10
  • GCF: 10

Method 3: The Euclidean Algorithm (For Large Numbers)

When you are dealing with massive numbers (like 4,500 and 3,250), listing factors takes too long. The Euclidean Algorithm is a clever subtraction trick (or division trick) that computers use.

The Rule: The GCF of two numbers is the same as the GCF of the smaller number and the difference between them.

  1. Divide the larger number by the smaller number.
  2. Take the remainder.
  3. Repeat the process using the smaller number and the remainder.
  4. When you reach a remainder of 0, the divisor you used is the GCF.

Why Use a GCF Calculator?

We often view GCF as just a classroom problem, but it solves practical logistics problems in construction, design, and manufacturing.

1. Simplifying Fractions

This is the most common use. To reduce a fraction like 16/24 to its simplest form, you find the GCF of the numerator (16) and denominator (24), which is 8.

  • 16 / 8 = 2
  • 24 / 8 = 3
  • Simplified fraction: 2/3

2. Tiling and Construction

Imagine you have a rectangular room that is 12 feet by 18 feet. You want to tile it with large square tiles without cutting any of them. What is the largest tile size you can use?

Finding the GCF of 12 and 18 gives you 6. You can use 6×6 foot tiles perfectly.

3. Fair Distribution (The “Party Bag” Problem)

If you have 24 apples and 36 oranges and want to pack them into bags so that every bag has the exact same number of apples and oranges with none left over, you need the GCF.

  • GCF of 24 and 36 is 12.
  • You can make 12 identical bags.

The Connection Between GCF and LCM

The Greatest Common Factor has a mathematical “cousin” called the Least Common Multiple (LCM). While GCF finds the biggest divider, LCM finds the smallest number that both integers can multiply into.

There is a beautiful formula that connects them:

GCF (a, b) x LCM(a, b) = a x b

This means if you know the GCF, you can easily find the LCM by multiplying your original numbers and dividing by the GCF.

FAQ

Q1. Can the GCF be 1?

A: Yes. If two numbers share no common factors other than 1, their GCF is 1. These numbers are called “co-prime” or “relatively prime.” An example is 8 and 9.

Q2. What is the GCF of a number and 0?

A: The GCF of any non-zero number n and 0 is simply the absolute value of n (|n|). This is because 0 is divisible by every number, so the largest common factor is determined entirely by the non-zero number.

Q.3 Can a GCF be negative?

A: No. By definition, factors are usually treated as positive integers in this context. Even if you input negative numbers into our calculator, the result will be positive because the “greatest” factor is determined by magnitude.

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

A: The logic remains the same. You find the common factors shared by all the numbers in the set. For example, to find the GCF of 10, 20, and 25, you look for a number that fits into all three. (In this case, it is 5).