GCF Calculator

Need to find the greatest common factor fast? Plug your numbers in and get the answer instantly. This calculator handles two numbers or several at once, so whether you're simplifying a fraction or solving a homework problem, you'll have what you need in seconds. Below the calculator, you'll find plain-English explanations of every method used to find the GCF, along with worked examples you can follow step by step.

Enter Details

Result

GCF of two integers

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Use the GCF Calculator

Using the calculator is straightforward. Enter two or more whole numbers, separated by commas, into the input field and hit Calculate. The result is the greatest common factor shared by all of the numbers you entered.

  • Enter at least two positive integers.
  • Separate multiple numbers with a comma (for example: 24, 36, 60).
  • The calculator returns the GCF and, depending on the tool, may also show the step-by-step method used.

If you get an unexpected result, double-check that you haven't accidentally entered a decimal or a negative number. The GCF is defined for positive integers only.

What Is the Greatest Common Factor (GCF)?

The greatest common factor of two or more numbers is the largest positive integer that divides evenly into all of them. No remainder, just clean division.

For example, the GCF of 12 and 18 is 6, because 6 goes into both 12 and 18 without leaving anything over, and no number larger than 6 can do the same.

You'll run into this concept constantly in math: reducing fractions, factoring polynomials, distributing quantities evenly. It's one of those foundational ideas that keeps showing up in different contexts.

Find the GCF of Two or More Numbers

There are a few reliable methods for finding the GCF, and which one you reach for usually depends on how big the numbers are and how much work you want to do by hand.

The most common approaches are listing factors, prime factorization, and the Euclidean algorithm. Listing factors works fine for small numbers. For larger ones, prime factorization or the Euclidean algorithm is much more practical.

When you need the GCF of three or more numbers, just find the GCF of the first two, then find the GCF of that result and the third number. Repeat until you've worked through the entire list.

Prime Factorization Method

Prime factorization is probably the most visual way to find the GCF. You break each number down into its prime building blocks, then look for what they have in common.

It takes a bit more work than plugging numbers into a calculator, but it's great for actually understanding why a particular number is the GCF, not just what it is.

Break Numbers into Prime Factors

Start by writing each number as a product of prime numbers. A prime number is one that can only be divided by 1 and itself, like 2, 3, 5, 7, 11, and so on.

Take 48 and 36 as an example:

  • 48 = 2 × 2 × 2 × 2 × 3 = 24 × 3
  • 36 = 2 × 2 × 3 × 3 = 22 × 32

A factor tree is a handy way to organize this. Start with the original number, split it into any two factors, then keep splitting until every branch ends in a prime. The primes at the ends of the branches are your prime factors.

Multiply the Common Prime Factors

Once you have both prime factorizations written out, identify the prime factors that appear in both lists. When a prime appears multiple times in each number, you take the smaller exponent.

Continuing with 48 and 36:

  • Both share 2. The smaller exponent is 2 (from 36), so you take 22 = 4.
  • Both share 3. The smaller exponent is 1 (from 48), so you take 31 = 3.

Multiply those together: 4 × 3 = 12. That's the GCF of 48 and 36.

Euclidean Algorithm

The Euclidean algorithm is the go-to method when you're dealing with numbers that would take forever to factor by hand. It's efficient, reliable, and doesn't require you to think about primes at all.

The core idea is simple: the GCF of two numbers is the same as the GCF of the smaller number and the remainder you get from dividing the larger by the smaller. You repeat this process until the remainder hits zero. The last non-zero remainder is your GCF.

Find GCF Using Division

Here's how it looks step by step for 252 and 105:

  1. Divide 252 by 105. You get 2 with a remainder of 42.
  2. Now divide 105 by 42. You get 2 with a remainder of 21.
  3. Divide 42 by 21. You get 2 with a remainder of 0.

The remainder just hit zero, so you're done. The last non-zero remainder was 21, and that's the GCF of 252 and 105.

Notice how you never had to think about prime factors. Each step is just basic long division.

GCF for Large Numbers

This is where the Euclidean algorithm really earns its keep. Trying to factor a number like 17,850 or 56,448 by hand is tedious and error-prone. The division method sidesteps all of that.

As long as you can divide, you can find the GCF of numbers with five, six, or more digits in just a handful of steps. The number of steps grows very slowly even as the numbers get much larger, which is why this algorithm has been trusted for over 2,000 years.

For anything beyond basic arithmetic, a calculator handles the repetition, but understanding the logic means you can spot mistakes and sanity-check results on the fly.

GCF vs LCM

The GCF and the least common multiple (LCM) are related, and people mix them up constantly. Here's the short version: the GCF is the largest factor shared by a set of numbers, while the LCM is the smallest multiple shared by them.

PropertyGCFLCM
What it findsLargest shared factorSmallest shared multiple
Use caseSimplifying fractionsAdding/subtracting fractions with unlike denominators
Example (12 and 18)636
Result is always…≤ the smaller number≥ the larger number

There's also a handy relationship between the two: for any two positive integers a and b, GCF(a, b) × LCM(a, b) = a × b. So if you know one, you can always find the other.

GCF Formula and Calculation Methods

There isn't a single universal formula the way there is for, say, the quadratic equation. Instead, the GCF is defined by its property: GCF(a, b) is the largest integer d such that d divides a and d divides b.

The relationship formula that's actually useful in practice is:

GCF(a, b) = a × b / LCM(a, b)

This lets you flip between GCF and LCM calculations easily. Beyond that, the three main calculation methods each have a sweet spot:

  • Listing factors: Best for small numbers (under 50 or so). Write out all the factors of each number, then find the biggest one they share.
  • Prime factorization: Great for understanding the math and for moderate-sized numbers. Takes more steps but clearly shows the structure.
  • Euclidean algorithm: Best for large numbers or when speed matters. Just repeated division until the remainder reaches zero.

GCF Calculation Examples

A few worked examples across different methods:

Example 1: GCF of 24 and 60 (listing factors)

  • Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
  • Factors of 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60
  • Common factors: 1, 2, 3, 4, 6, 12. The greatest is 12.

Example 2: GCF of 90 and 135 (prime factorization)

  • 90 = 2 × 32 × 5
  • 135 = 33 × 5
  • Common factors: 32 × 5 = 45

Example 3: GCF of 500 and 750 (Euclidean algorithm)

  1. 750 ÷ 500 = 1 remainder 250
  2. 500 ÷ 250 = 2 remainder 0

GCF = 250.

Simplifying Fractions Using GCF

This is one of the most practical everyday uses of the GCF. To reduce a fraction to its simplest form, divide both the numerator and the denominator by their GCF.

Say you have the fraction 48/72. Find GCF(48, 72), which is 24. Divide the top and bottom by 24:

  • 48 ÷ 24 = 2
  • 72 ÷ 24 = 3

So 48/72 simplifies to 2/3. You know it's fully simplified because 2 and 3 share no common factors other than 1, meaning their GCF is 1. A fraction is in its lowest terms when the GCF of the numerator and denominator equals 1, which is sometimes called having coprime numbers.

If you divide by something less than the GCF, the fraction gets smaller but isn't fully reduced yet. Using the GCF gets it done in one step.

GCF, GCD, and HCF Explained

If you've seen all three of these terms and wondered whether they mean different things, the answer is no. They're the same concept with different names depending on where you learned math.

  • GCF (Greatest Common Factor) is most common in American schools and textbooks.
  • GCD (Greatest Common Divisor) is widely used in higher mathematics, computer science, and programming contexts.
  • HCF (Highest Common Factor) is the standard term in British and Commonwealth educational systems.

All three refer to the largest positive integer that divides evenly into a given set of numbers. The calculation methods are identical regardless of which name you're using. So if a programming library calls a function gcd() or a textbook from the UK says HCF, you're working with exactly the same thing as the GCF you know.

Other Maths Calculators

Explore all