Greatest Common Factor Calculator
Find the greatest common factor (GCF/GCD) and least common multiple (LCM) of two or more numbers.
Greatest Common Factor Calculator: Formula, Worked Examples & Complete Guide
Written by Mathew | Financial Tools & Calculation Specialist · Last updated July 31, 2026
In two sentences: A greatest common factor calculator finds the largest number that divides evenly into two or more numbers, using either prime factorization or the faster Euclidean algorithm, which repeatedly divides and takes remainders until reaching zero. This guide breaks down both methods, worked examples, and the real-world uses of GCF beyond the math classroom.
What Is a Greatest Common Factor Calculator?
A greatest common factor calculator finds the GCF — sometimes called the Greatest Common Divisor (GCD) — of a set of numbers. The GCF is the largest whole number that divides evenly into every number in the set, with no remainder left over.
The Greatest Common Factor Formula
Method 1: Prime factorization
1. Break each number into its prime factors.
2. Identify the prime factors common to all numbers.
3. Multiply those shared primes together, using the lowest power of each.
4. The result is the GCF.
Method 2: The Euclidean algorithm
GCF(a, b) = GCF(b, a mod b)
Repeat, replacing a with b and b with the remainder, until the remainder is 0.
The last non-zero remainder is the GCF.
Worked Examples
Example 1: Finding GCF using prime factorization
Find the greatest common factor of 36 and 84.
36 = 2² × 3²
84 = 2² × 3 × 7
Shared primes at the lowest shared power: 2² × 3¹ = 4 × 3 = 12
GCF(36, 84) = 12
Example 2: Finding GCF using the Euclidean algorithm
Find the greatest common factor of 270 and 192.
270 = 1 × 192 + 78
192 = 2 × 78 + 36
78 = 2 × 36 + 6
36 = 6 × 6 + 0
GCF(270, 192) = 6
The Euclidean algorithm reaches the answer in four quick division steps, without needing to fully factor either number into primes — this is why a greatest common factor calculator typically uses this method internally for larger numbers, where prime factorization would be slower.
Example 3: Finding GCF for three numbers
Find the greatest common factor of 24, 36, and 60.
24 = 2³ × 3
36 = 2² × 3²
60 = 2² × 3 × 5
Shared primes at lowest power: 2² × 3¹ = 4 × 3 = 12
GCF(24, 36, 60) = 12
For three or more numbers, a greatest common factor calculator typically finds the GCF of the first two, then finds the GCF of that result with the next number, and so on until all numbers are included.
Example 4: Using GCF to simplify a fraction
Simplify the fraction 84/126 using its greatest common factor.
84 = 2² × 3 × 7
126 = 2 × 3² × 7
GCF(84, 126) = 2 × 3 × 7 = 42
84 ÷ 42 = 2
126 ÷ 42 = 3
Simplified fraction: 2/3
Step-by-Step: How to Use a Greatest Common Factor Calculator
- Enter two or more whole numbers.
- For smaller numbers, the calculator may break each into prime factors and identify the shared primes at their lowest power.
- For larger numbers, the calculator typically switches to the faster Euclidean algorithm, repeatedly dividing and taking remainders.
- For more than two numbers, the calculator applies the process pairwise, combining the running result with each additional number.
- Use the result directly to simplify fractions, divide items into equal groups, or solve related word problems.
Real-World Uses for a Greatest Common Factor Calculator
- Simplifying fractions — dividing both the numerator and denominator by their GCF reduces any fraction to its simplest form in a single step.
- Dividing items into equal groups without leftovers — if you have 84 apples and 126 oranges and want to make identical gift baskets, the GCF (42) tells you the maximum number of baskets you can make, with each basket getting an equal, whole-number split of both fruits.
- Cutting materials with minimal waste — the GCF of two lengths tells you the largest equal-sized piece you can cut both into without any leftover material.
- Simplifying ratios — reducing a ratio like 84:126 to its simplest form (2:3) uses exactly the same GCF calculation as simplifying a fraction.
- Cryptography and computer science — the Euclidean algorithm for finding GCF is foundational to several encryption algorithms and computational number theory applications.
GCF vs. LCM: How They’re Related
While a greatest common factor calculator focuses specifically on GCF, it’s worth understanding the relationship to LCM (Least Common Multiple), since the two are mathematically linked:
LCM(a, b) = (a × b) ÷ GCF(a, b)
This means once you know the GCF of two numbers, finding their LCM takes just one more multiplication and division step, without needing a separate full calculation.
Using a Greatest Common Factor Calculator for Word Problems
A greatest common factor calculator is most useful once you recognize the specific type of word problem that calls for GCF rather than LCM, since students often confuse when to use each.
Recognizing a GCF problem
GCF problems typically involve dividing things into equal groups or finding the largest possible equal size. Common phrasing includes “what is the largest possible group size,” “how many identical bundles can be made,” or “what is the greatest length you can cut pieces into.” If a problem asks about the smallest number that multiple things have in common instead — like “when will two events next happen on the same day” — that’s an LCM problem, not a GCF problem.
A worked word problem
A teacher has 60 pencils and 84 erasers and wants to make identical gift bags for students, using all the pencils and erasers with nothing left over. What’s the maximum number of gift bags possible, and what would each bag contain?
GCF(60, 84):
60 = 2² × 3 × 5
84 = 2² × 3 × 7
GCF = 2² × 3 = 12
Maximum gift bags = 12
Pencils per bag = 60 ÷ 12 = 5
Erasers per bag = 84 ÷ 12 = 7
A greatest common factor calculator solves this instantly, but recognizing that “maximum equal groups using everything, no leftovers” is a GCF signal — not an LCM one — is the actual skill being tested in problems like this.
Frequently Asked Questions
Nothing — Greatest Common Factor (GCF) and Greatest Common Divisor (GCD) refer to the exact same calculation. The terminology simply varies by textbook, region, or educational curriculum.
Because factoring very large numbers into their prime components can be computationally slow, especially for large primes, while the Euclidean algorithm only requires repeated division and remainder calculation — a much faster operation that doesn’t require identifying any prime factors at all.
Yes — when two numbers share no common prime factors, their GCF is 1, and they’re called “coprime” or “relatively prime” to each other, even though neither number individually needs to be prime.
No — GCF can be calculated for any set of two or more whole numbers using the pairwise method, which extends naturally regardless of how many numbers are included in the set.
Related Calculators
Solar Saving Calculator By State
Scientific Notation Calculator
In summary, a greatest common factor calculator solves one of the most foundational problems in number theory, and understanding both the prime factorization method and the faster Euclidean algorithm gives you two reliable ways to verify any result by hand.
About the author: Magesh is a Financial Tools & Calculation Specialist focused on building and fact-checking online calculators across mathematics and everyday problem-solving tools.
Note: This calculator and article are provided for general educational and informational purposes only. While the underlying math is exact for whole numbers, always double-check results for critical academic or professional applications.