๐Ÿ‡บ๐Ÿ‡ธ USC
Math & Conversion
๐Ÿ”ข

GCF Calculator

Greatest common factor of two or more integers

๐Ÿ”ข Enter your numbers

Tip: enter two or more whole numbers. Negative signs and zeros are handled automatically.

โœ… Greatest common factor

12
GCF of 24, 36, 60

๐Ÿ“‹ Factors of each number

Factors of 24
1234681224
Factors of 36
123469121836
Factors of 60
123456101215203060

Highlighted values are factors shared by every number. The largest of them is the GCF.

๐Ÿค Common factors

1234612

Every value above divides all of your numbers. The boxed value is the greatest - the GCF.

๐Ÿงฎ Euclidean algorithm steps

StepComputeRunning GCF
1gcd(24, 36)12
2gcd(12, 60)12

For more than two numbers, the GCF is found by chaining: gcd(a, b, c) = gcd(gcd(a, b), c).

The greatest common factor (also called the greatest common divisor, GCD) is the largest positive integer that divides every input with no remainder. This tool uses the Euclidean algorithm and lists each number's full set of factors.

โœ…

Last updated June 2026

Method: The greatest common factor is computed with the Euclidean algorithm, gcd(a, b) = gcd(b, a mod b), chained across all inputs. This is the standard, exact method used in mathematics - no rounding or estimation.

Included: The GCF (GCD) of two or more integers, the complete list of factors for each number, the shared common factors, and a step-by-step trace of the algorithm.

Not included: Decimals, fractions, and non-integer values. The GCF is defined only for whole numbers; for fractions, find the GCF of the numerators and the LCM of the denominators separately.

GCF calculator: everything you need to know

The greatest common factor (GCF) of a set of integers is the biggest whole number that divides each of them with nothing left over. Take 24 and 36: the largest number that goes evenly into both is 12, so GCF(24, 36) = 12. You will also see it called the greatest common divisor (GCD) or highest common factor (HCF) - same idea, different name. This GCF calculator finds it instantly for two or more numbers, lists the factors of each, and shows the common factors they share.

Definition and the Euclidean formula

Formally, the GCF is the largest positive integer that divides every input exactly. The fastest way to compute it is the Euclidean algorithm, which uses one elegant rule:

gcd(a, b) = gcd(b, a mod b),  until b = 0 → gcd = a

In words: replace the larger number with the remainder of dividing it by the smaller, and repeat. When the remainder hits zero, the last non-zero value is your GCF. For three or more numbers, you simply chain it: gcd(a, b, c) = gcd(gcd(a, b), c). The algorithm is ancient - it appears in Euclid's Elements from around 300 BC - and it is still the method computers use today because it is dramatically faster than listing every factor.

Worked example: GCF of 24 and 36

Listing factors makes the idea concrete. The factors of 24 are 1, 2, 3, 4, 6, 8, 12, 24. The factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36. The numbers they have in common are 1, 2, 3, 4, 6, and 12, and the greatest of those is 12. The Euclidean algorithm reaches the same answer in two quick steps: gcd(36, 24) = gcd(24, 12) = gcd(12, 0) = 12. Both routes agree, which is exactly what the calculator displays - the factor lists for the intuition and the algorithm steps for the speed.

How to use this GCF calculator

You only need your numbers. Just three steps:

  1. Enter two or more integers in the input box, separated by commas (spaces and semicolons work too). For example, type 24, 36, 60.
  2. Read the GCF at the top - the large blue number is the greatest common factor of everything you entered.
  3. Scroll the breakdown to see each number's factors (shared ones are highlighted), the list of common factors, and the Euclidean algorithm steps.

The result updates as you type, so you can experiment freely. Negative signs and zeros are handled automatically, and invalid entries (like decimals or letters) produce a clear message instead of a wrong answer.

Who this calculator is for

  • Students learning number theory, factoring, or fraction simplification who want to check homework and see the steps.
  • Parents and tutors helping with middle-school and pre-algebra math who need a quick, reliable answer.
  • Teachers building examples and verifying answer keys for worksheets and quizzes.
  • Programmers sanity-checking a GCD implementation against a known-good result.
  • Anyone reducing fractions or splitting things into equal groups who needs the largest common divisor fast.

Key terms explained

  • Factor (divisor): a whole number that divides another with no remainder. 6 is a factor of 24 because 24 / 6 = 4.
  • Common factor: a number that is a factor of every value in the set. 1, 2, 3, 4, 6 and 12 are the common factors of 24 and 36.
  • Greatest common factor (GCF): the largest of those shared factors.
  • Coprime / relatively prime: numbers whose GCF is 1, meaning they share no common factor other than 1.
  • Prime factorization: writing a number as a product of primes (24 = 2³ x 3). The GCF is the product of the prime factors common to all numbers, each taken to its lowest shared power.
  • LCM (least common multiple): the smallest number that every value divides into - the "opposite" of the GCF and closely linked to it.

Worked example: three numbers (24, 36, 60)

For more than two values, chain the algorithm. First find gcd(24, 36) = 12. Then take that result with the next number: gcd(12, 60) = 12. So GCF(24, 36, 60) = 12. You can verify with factors: 12 divides 24 (24/12 = 2), 36 (36/12 = 3), and 60 (60/12 = 5), and no larger number divides all three. The order you process the numbers in never changes the answer.

Worked example: coprime numbers (8 and 15)

The factors of 8 are 1, 2, 4, 8 and the factors of 15 are 1, 3, 5, 15. The only value they share is 1, so GCF(8, 15) = 1 and the numbers are coprime. This is common and perfectly normal - it simply means a fraction like 8/15 is already in lowest terms and cannot be reduced further.

Prime-factorization method

Besides the Euclidean algorithm, you can find the GCF by prime factorization. Break each number into primes, then multiply the primes they all share, using the smallest power that appears in every number. This table shows the idea for 24 and 36:

Number Prime factorization Powers of 2 Powers of 3
242³ x 3
362² x 3²
GCF2² x 3 = 122² (lowest)3¹ (lowest)

Take 2 to the lower power (2² from 36 vs 2³ from 24, so 2²) and 3 to the lower power (3¹). Multiply: 4 x 3 = 12. Same answer as the Euclidean method. This approach is especially intuitive once you can read a number's prime breakdown at a glance - the Prime Factorization Calculator gives you each number's primes so you can line them up and pick the lowest shared powers.

Reference: GCF of common number pairs

A quick lookup for some everyday pairs you might run into when simplifying fractions or grouping items:

Numbers GCF Notes
12 and 18612/18 reduces to 2/3
16 and 24816/24 reduces to 2/3
48 and 18012larger numbers, same idea
7 and 131both prime, so coprime
100 and 752575/100 reduces to 3/4
24, 36 and 6012works for three or more numbers

Why the GCF matters: real uses

  • Simplifying fractions: divide numerator and denominator by their GCF to reach lowest terms in one step.
  • Splitting into equal groups: the GCF tells you the largest equal-sized batches you can make from different quantities (for example, the most identical gift bags from 24 pens and 36 erasers is 12 bags).
  • Factoring algebra: pulling the greatest common factor out of a polynomial's terms is the first step in factoring.
  • Tiling and measurement: the largest square tile that fits a 48 by 180 cm area evenly is the GCF, 12 cm.

GCF and LCM: two sides of one coin

The greatest common factor and the least common multiple are linked by a tidy identity for any two positive integers: GCF(a, b) x LCM(a, b) = a x b. So once you have the GCF, the LCM is just one division away: LCM(a, b) = (a x b) / GCF(a, b). For 24 and 36 that gives LCM = (24 x 36) / 12 = 72. Where the GCF is the biggest number that divides both, the LCM is the smallest number both divide into. If you need the multiple directly, the LCM Calculator computes it without the extra step. Note that this product identity holds for exactly two numbers - for three or more values you cannot simply divide the product by the GCF to get the LCM.

Tips for finding the GCF by hand

  • The GCF can never be larger than the smallest number, so that value is your ceiling.
  • If the smaller number divides the larger evenly, the smaller number is the GCF (for example, GCF(6, 18) = 6).
  • If both numbers are even, 2 is a common factor; if both end in 0 or 5, 5 is. Strip out obvious shared factors first.
  • For big numbers, skip listing factors and use the Euclidean algorithm - it converges in just a few steps.

Three ways to find the GCF, compared

There is no single "correct" way to find the greatest common factor - three methods all reach the same answer, and which one is easiest depends on the numbers in front of you. Knowing all three lets you pick the fastest route by hand and understand exactly what the calculator is doing under the hood.

  • Listing factors: write out every factor of each number, circle the ones they share, and take the largest. It is the most concrete method and great for teaching the concept, but it gets slow and error-prone for numbers above 100, where the factor lists grow long.
  • Prime factorization: break each number into primes, then multiply the shared primes at their lowest powers. This shines when the numbers factor cleanly (like 24 and 36) and it doubles as a way to find the LCM at the same time, but factoring a large number into primes can itself be hard.
  • Euclidean algorithm: repeatedly replace the larger number with the remainder until one becomes zero. It needs no factoring at all, finishes in a handful of steps even for huge numbers, and is the method built into this calculator and into virtually every programming language's GCD function.

For small classroom numbers, listing factors builds intuition. For anything large, the Euclidean algorithm wins decisively - which is exactly why it has survived for more than two thousand years.

Why the Euclidean algorithm is so fast

The reason the Euclidean algorithm beats listing factors is that each step shrinks the numbers dramatically rather than testing one candidate at a time. Every time you take a remainder, the value drops by at least a factor related to the golden ratio, so even numbers in the millions resolve in only a few dozen steps. Listing factors, by contrast, can require checking thousands of candidate divisors for a large number. A worked trace makes the speed obvious: to find GCF(1071, 462), you compute 1071 mod 462 = 147, then 462 mod 147 = 21, then 147 mod 21 = 0 - so the GCF is 21, reached in just three divisions. Trying to list all the factors of 1071 and 462 by hand would take far longer and invite mistakes. This efficiency is why the algorithm underpins everything from reducing fractions in a spreadsheet to the cryptography that secures online banking.

GCF in word problems: a worked scenario

Word problems are where the greatest common factor earns its keep, because the phrase "largest equal groups" or "biggest identical size" is almost always a GCF question in disguise. Suppose a teacher has 48 pencils and 36 erasers and wants to assemble the most identical supply kits possible, using up everything with none left over. The number of kits must divide both 48 and 36 evenly, and you want the largest such number - that is exactly GCF(48, 36) = 12. So the teacher can make 12 kits, each holding 4 pencils (48 / 12) and 3 erasers (36 / 12). The same pattern solves dozens of everyday puzzles: cutting two ribbons of 48 cm and 36 cm into equal pieces with no waste, arranging 48 and 36 chairs into equal rows, or splitting two batches of items into matching gift bags. Whenever you see "equal," "identical," "without remainder," and "largest," reach for the GCF.

GCF of three or more numbers in depth

Extending the GCF beyond two numbers is straightforward but worth understanding rather than memorizing. Because the GCF operation is associative, you can fold a whole list together two at a time: GCF(a, b, c, d) = GCF(GCF(GCF(a, b), c), d). The running result can only stay the same or get smaller as you add each number, never larger, since every new value can only remove shared factors. A practical shortcut follows: as soon as the running GCF reaches 1, you can stop - once a single pair is coprime, the whole set is coprime and the final answer is 1. For example, in the list 30, 42, 70, 35 you find GCF(30, 42) = 6, then GCF(6, 70) = 2, then GCF(2, 35) = 1, so the GCF of all four is 1 and there is no need to check further. This calculator applies the same chaining automatically, which is why you can paste a long list of numbers and still get an instant answer.

Limitations and what this tool does not do

This calculator is exact and unlimited in everyday use, but a few boundaries are worth naming so the results are never surprising. It works on integers only - decimals, fractions, and irrational numbers have no greatest common factor in the ordinary sense, so an entry like 2.5 or 3/4 will be flagged rather than guessed at. It strips signs and treats negative numbers by their absolute value, returning a positive GCF, which matches standard mathematical convention. The single genuinely undefined input is GCF(0, 0), because every integer divides zero and so no greatest divisor exists; any other zero in the list simply drops out, since GCF(0, n) = n. The tool does not factor variables or polynomials - for pulling a common factor out of an algebraic expression you apply the same idea to the coefficients and shared variables by hand. Finally, results are mathematically exact with no rounding, so what you see is the true GCF, not an approximation.

Related math concepts and calculators

The GCF sits in a family of number-theory ideas. To find the smallest shared multiple instead, use the LCM Calculator - it is the natural companion to this page, and the two are tied together by the identity GCF × LCM = a × b. To see the prime building blocks of a single number, the Prime Factorization Calculator breaks it into primes, which is the same machinery the prime-factorization method above relies on. To turn the GCF into a reduced fraction, the Fraction Calculator does the division for you, and the Long Division Calculator shows each remainder step if you want to perform the Euclidean algorithm by hand. Percentages, ratios, and averages build on the same comfort with whole-number relationships. Each tackles a different everyday question, but they all start with the same skill: understanding how numbers divide into one another.

๐Ÿ’ก Good to know

GCF, GCD and HCF are the same thing

Don't be thrown by the different names. Greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) all describe the largest integer that divides every number evenly. This calculator returns that single value no matter which term your textbook uses.

A GCF of 1 doesn't mean a mistake

If your numbers come back with a GCF of 1, they are simply coprime - they share no factor but 1. That is a valid, common result, and it means any fraction built from them is already fully reduced.

Use the GCF to reduce fractions in one move

Instead of cancelling factors one at a time, divide the numerator and denominator by their GCF and you land on lowest terms immediately. For 24/36, dividing both by 12 gives 2/3 right away.

โš ๏ธ Common mistakes & edge cases

Confusing the GCF with the LCM

The GCF is the largest number that divides into your values; the LCM is the smallest number they divide into. They are opposites. For 24 and 36 the GCF is 12 but the LCM is 72 - mixing them up is the most frequent error.

Stopping at a common factor instead of the greatest one

2 and 6 are both common factors of 24 and 36, but neither is the GCF. The answer is the largest shared factor, 12. Always check whether a bigger common factor exists.

Trying to use decimals or fractions

The GCF is defined only for integers. Entering 2.5 or 3/4 has no greatest common factor. For fractions, take the GCF of the numerators and the LCM of the denominators separately.

Mishandling zero

GCF(0, n) equals n, since every integer divides zero - a zero in the list simply drops out. But GCF(0, 0) is undefined, because no greatest divisor exists when both numbers are zero.

Note: This calculator works with whole numbers only and returns an exact result - there is no rounding or estimation involved.

❓ Frequently asked questions

What is the greatest common factor (GCF)?

The greatest common factor of two or more integers is the largest positive whole number that divides each of them with no remainder. For example, the GCF of 24 and 36 is 12, because 12 is the biggest number that goes evenly into both. It is also called the greatest common divisor (GCD) or highest common factor (HCF) - all three terms mean exactly the same thing.

Is GCF the same as GCD?

Yes. GCF (greatest common factor), GCD (greatest common divisor), and HCF (highest common factor) are three names for the identical concept: the largest integer that divides every number in the set. American textbooks tend to say GCF, while many computer-science and international sources say GCD. This calculator computes the same value regardless of which name you use.

How does the Euclidean algorithm find the GCF?

The Euclidean algorithm repeatedly replaces the larger number with the remainder of dividing it by the smaller one: gcd(a, b) = gcd(b, a mod b). You keep going until the remainder is 0; the last non-zero value is the GCF. For example, gcd(48, 36) = gcd(36, 12) = gcd(12, 0) = 12. It is far faster than listing every factor, especially for large numbers.

How do I find the GCF of more than two numbers?

Find the GCF of the first two numbers, then take the GCF of that result with the next number, and so on: gcd(a, b, c) = gcd(gcd(a, b), c). The order does not matter - you get the same answer either way. This calculator chains the Euclidean algorithm automatically and shows each step.

What does it mean if the GCF is 1?

If the greatest common factor is 1, the numbers share no common factor other than 1 and are called coprime or relatively prime. For example, 8 and 15 have a GCF of 1. This does not mean either number is prime - it only means they have no prime factors in common.

What is the GCF of a number and zero?

By the standard convention, GCF(0, n) equals n, because every integer divides 0 evenly. So including a zero in your list does not change the answer. The one undefined case is GCF(0, 0), which has no greatest common factor because every integer divides zero.

How is the GCF used to simplify fractions?

To reduce a fraction to lowest terms, divide both the numerator and denominator by their GCF. For example, 24/36 has a GCF of 12, so 24/36 = (24/12) / (36/12) = 2/3. Dividing by the GCF in one step gives the fully simplified fraction immediately, instead of cancelling common factors one at a time.

What is the relationship between GCF and LCM?

For any two positive integers, the product of their GCF and least common multiple (LCM) equals the product of the numbers themselves: GCF(a, b) x LCM(a, b) = a x b. So if you know the GCF, you can find the LCM with LCM(a, b) = (a x b) / GCF(a, b). For 24 and 36, GCF = 12 and LCM = (24 x 36) / 12 = 72.

Can the GCF be larger than the smallest number?

No. The GCF can never exceed the smallest number in the set, because a factor of a number cannot be bigger than the number itself. The GCF equals the smallest number exactly when that smallest number divides all the others - for instance, GCF(6, 12, 18) = 6.

Does this calculator handle negative numbers?

Yes. The greatest common factor is defined for the absolute values, so a sign does not matter: GCF(-24, 36) = GCF(24, 36) = 12. The calculator strips the signs automatically and always returns a positive GCF.

What is the fastest way to find the GCF of large numbers?

The Euclidean algorithm is by far the fastest method for large numbers. Instead of listing every factor, you repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is 0. For example, GCF(1071, 462) takes just three steps: 1071 mod 462 = 147, 462 mod 147 = 21, 147 mod 21 = 0, so the GCF is 21. This calculator uses this method, so even numbers in the millions resolve instantly.

How do I know when a word problem is asking for the GCF?

Word problems that ask for the largest equal groups, the biggest identical size, or how to split quantities evenly with nothing left over are GCF problems. For example, making the most identical kits from 48 pencils and 36 erasers means finding GCF(48, 36) = 12 kits. Look for the keywords largest, equal, identical, and without remainder together.

Related Calculators