GCF Calculator — Greatest Common Factor (GCD) of Two or More Numbers
The largest number that divides into all of your values, computed two ways
The greatest common factor (GCF) — also called the greatest common divisor (GCD) or highest common factor (HCF) — is the largest whole number that divides evenly into every number in your set. It's the math you use to reduce a fraction to lowest terms, simplify a ratio, split things into the biggest equal groups, or factor an algebra expression. The terms GCF and GCD mean exactly the same thing; teachers in the US usually say GCF, while "GCD" shows up more in computer science and number theory.
There are two reliable ways to find it, and this calculator shows both.
1. Prime factorization. Break each number into its prime factors, then multiply the primes they all share, using the lowest power that appears in every number. For 48 and 180: 48 = 2⁴ × 3 and 180 = 2² × 3² × 5. The shared primes are 2 and 3. Take the lowest power of each — 2² and 3¹ — so GCF = 2² × 3 = 4 × 3 = 12. Any prime that doesn't appear in every number (like the 5 in 180) is left out.
2. The Euclidean algorithm. This is the fast method computers use, and it never needs you to factor anything. Divide the larger number by the smaller and keep the remainder; then divide the previous divisor by that remainder; repeat until the remainder is 0. The last nonzero remainder is the GCF. For 180 and 48: 180 = 3×48 + 36, then 48 = 1×36 + 12, then 36 = 3×12 + 0 → the last nonzero remainder is 12. For three or more numbers, the GCF is associative: gcf(a, b, c) = gcf(gcf(a, b), c), so the algorithm just folds across the list one pair at a time.
A few facts that trip people up. The GCF is always at least 1 (every pair of integers shares the factor 1), and when the GCF is exactly 1 the numbers are called coprime or relatively prime — for example 8 and 15. The GCF can never be larger than the smallest number in the set, and if the smallest number divides all the others, that smallest number is the GCF (gcf(6, 12, 18) = 6). Order doesn't matter, and signs don't matter — gcf(−48, 180) = 12 — because divisibility ignores sign.
The GCF has a close partner, the least common multiple (LCM), the smallest number all of your values divide into. For two numbers they're linked by the identity GCF × LCM = a × b, so once you have one you can get the other. This page focuses on the greatest common factor and shows the prime factorization, the Euclidean steps, and the complete list of shared divisors so you can check the answer by hand.
Calculator
Fill in the fields and click "Calculate" for instant results.
📰 Formula
• Prime factorization: GCF = product of each shared prime raised to its lowest power across all numbers. • Euclidean algorithm (two numbers): gcd(a, 0) = a; gcd(a, b) = gcd(b, a mod b) — repeat until the remainder is 0; the last nonzero remainder is the GCF. • Three or more: gcf(a, b, c) = gcf(gcf(a, b), c) — fold across the list one pair at a time. • Identity (two numbers): GCF × LCM = a × b.
📰 Formula
• Prime factorization: GCF = product of each shared prime raised to its lowest power across all numbers. • Euclidean algorithm (two numbers): gcd(a, 0) = a; gcd(a, b) = gcd(b, a mod b) — repeat until the remainder is 0; the last nonzero remainder is the GCF. • Three or more: gcf(a, b, c) = gcf(gcf(a, b), c) — fold across the list one pair at a time. • Identity (two numbers): GCF × LCM = a × b.
🧪 Worked examples
Example 2
Example 3
Example 4
⚠️ Common mistakes
- Multiplying all the shared primes at their highest power instead of the lowest — that gives a number too big to divide every value.
- Including a prime that appears in only some of the numbers, not all of them.
- Confusing the GCF (largest shared factor) with the LCM (smallest shared multiple).
- Stopping the Euclidean algorithm at the wrong step — the answer is the last nonzero remainder, not the final 0.
- Assuming numbers with no obvious common factor have a GCF of 0; the GCF is always at least 1.
💡 Tips
- The GCF can never exceed the smallest number in your set — that's a quick sanity check.
- If the smallest number divides all the others, it is the GCF; you can stop right there.
- A GCF of 1 means the numbers are coprime (relatively prime), which is exactly what you want for a fraction already in lowest terms.
- Signs don't matter — gcf(−48, 180) equals gcf(48, 180); divisibility ignores negatives.
- For two numbers, use GCF × LCM = a × b to jump straight from one answer to the other.
Embed this calculator on your site
Copy the code below and paste it into the HTML of your site or blog.
<iframe src="https://www.calcnimbus.com/embed/gcf-calculator" width="100%" height="500" frameborder="0" style="border:1px solid #eee;border-radius:12px"></iframe>
❓ Frequently asked questions
What is the greatest common factor (GCF)?
The GCF is the largest whole number that divides evenly into every number in your set. For 48 and 180 it's 12, because 12 is the biggest number that goes into both with no remainder.
Is the GCF the same as the GCD or HCF?
Yes — greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) are three names for the same thing. US schools usually say GCF, while GCD is common in computer science and number theory.
How do I find the GCF using prime factorization?
Factor each number into primes, find the primes that appear in every number, and multiply each shared prime raised to its lowest power. For 48 = 2⁴·3 and 180 = 2²·3²·5, the shared part is 2²·3 = 12.
What is the Euclidean algorithm?
It's a fast way to find the GCF without factoring. Divide the bigger number by the smaller, replace the pair with the divisor and the remainder, and repeat until the remainder is 0. The last nonzero remainder is the GCF — for 180 and 48 it lands on 12.
How do I find the GCF of three or more numbers?
Find the GCF of the first two, then take the GCF of that result with the next number, and so on. The operation is associative, so gcf(a, b, c) = gcf(gcf(a, b), c), and the order of the numbers doesn't change the answer.
What is the GCF if the numbers share no common factors?
It's 1, never 0. Every pair of whole numbers shares the factor 1, so the GCF is at least 1. When the GCF is exactly 1 the numbers are called coprime or relatively prime, like 8 and 15.
What's the difference between GCF and LCM?
The GCF is the largest number that divides into all your values; the LCM is the smallest number all your values divide into. For two numbers they're linked by GCF × LCM = a × b, so 48 and 180 give GCF 12 and LCM 720 (12 × 720 = 48 × 180).
How do I use the GCF to simplify a fraction?
Divide the numerator and the denominator by their GCF. For 48/180, the GCF is 12, so 48 ÷ 12 = 4 and 180 ÷ 12 = 15, giving 4/15 in lowest terms.
Can I enter negative numbers or decimals?
Use whole numbers — the GCF is defined for integers. Negatives are fine because signs are ignored (gcf(−48, 180) = 12), but decimals and fractions don't have a standard GCF, so the calculator rounds or rejects non-integers.