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
๐ Factors of each number
Highlighted values are factors shared by every number. The largest of them is the GCF.
๐ค Common factors
Every value above divides all of your numbers. The boxed value is the greatest - the GCF.
๐งฎ Euclidean algorithm steps
| Step | Compute | Running GCF |
|---|---|---|
| 1 | gcd(24, 36) | 12 |
| 2 | gcd(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:
- Enter two or more integers in the input box, separated by commas (spaces and semicolons work too). For example, type
24, 36, 60. - Read the GCF at the top - the large blue number is the greatest common factor of everything you entered.
- 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 |
|---|---|---|---|
| 24 | 2³ x 3 | 2³ | 3¹ |
| 36 | 2² x 3² | 2² | 3² |
| GCF | 2² x 3 = 12 | 2² (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.
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 18 | 6 | 12/18 reduces to 2/3 |
| 16 and 24 | 8 | 16/24 reduces to 2/3 |
| 48 and 180 | 12 | larger numbers, same idea |
| 7 and 13 | 1 | both prime, so coprime |
| 100 and 75 | 25 | 75/100 reduces to 3/4 |
| 24, 36 and 60 | 12 | works 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.
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.
Related math concepts and calculators
The GCF sits in a family of number-theory ideas. To find the smallest shared multiple instead, use an LCM calculator. To turn the GCF into a reduced fraction, a Fraction Calculator does the division for you. 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.
❓ 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.
Related Calculators
Percentage Calculator
Solve any percentage problem - what is X% of Y and more
Fraction Calculator
Add, subtract, multiply and divide fractions
Scientific Calculator
A full scientific calculator with trig, logs and more
Average Calculator
Calculate the mean, median and mode of numbers
GPA Calculator
Calculate your grade point average (weighted or unweighted)
Ratio Calculator
Simplify, scale and solve ratios and proportions