Find the Greatest Common Factor (GCF) or Greatest Common Divisor (GCD) of two or more numbers using Euclidean algorithm and prime factorization methods with step-by-step explanations.
Enter positive integers separated by commas (2-10 numbers recommended)
Simple GCF example
GCF of three numbers
Larger numbers with common factors
Numbers with multiple common factors
Numbers with 2 as common factor
Prime numbers (GCF = 1)
Problem 1: Simplify 48/72
What is the GCF of 48 and 72? What is the simplified fraction?
Problem 2: Resource Division
36 students need to be divided into groups of equal size. The maximum group size is the GCF of 36 and what number?
Problem 3: Pattern Recognition
Find the largest number that divides both 84 and 96 evenly.
Problem 4: Three Numbers
What is the GCF of 24, 36, and 48? Try both methods.
Problem 5: Large Numbers
Calculate GCF of 126, 162, and 198. What prime factors do they share?
Fundamental concept in number theory, used in cryptography and modular arithmetic
Simplifying rational expressions and finding common denominators
Used in algorithms for data compression and hash table implementation
Signal processing, gear ratios, and synchronization problems
The Greatest Common Factor (GCF), also known as the Greatest Common Divisor (GCD), is the largest positive integer that divides two or more numbers without leaving a remainder. It represents the largest number that can evenly divide all given numbers.
For integers a, b, and d (where d ≠ 0), d is a common divisor if d divides a and d divides b. The greatest common divisor is the largest such positive integer.
The GCF can also be defined as the largest positive integer d such that a = d×m and b = d×n for some integers m and n.
Euclidean Algorithm
An efficient method using repeated division and remainders based on the property that
Prime Factorization
Factor each number into primes, then take the product of the lowest power of common primes
List Method
List all divisors of each number and find the greatest common one (works for small numbers)
Bezout's Identity: For any integers a and b, there exist integers x and y such that:
This shows that the GCF can always be expressed as a linear combination of the original numbers.
The Euclidean algorithm has logarithmic time complexity O(log min(a,b)). Each step reduces the problem size by at least half.
Every positive integer greater than 1 can be uniquely expressed as a product of prime numbers. For GCF calculation:
You're packing party bags. Each bag gets some cookies and some brownies. Every bag must be identical. No leftovers. What's the maximum number of bags you can make?
The answer is 12. And the thing that gets you there — GCF — also happens to be what keeps your bank account secure. Not an exaggeration.
A factor is any number that divides evenly into another. Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 8: 1, 2, 4, 8.
Common factors of 12 and 8 — numbers in both lists: 1, 2, 4. The greatest of those is 4.
So GCF(12, 8) = 4. The largest number that divides into both without a remainder.
GCF and GCD (Greatest Common Divisor) mean the same thing. Mathematicians say GCD. Teachers say GCF. Same calculation either way.
Back to the cookies: GCF(48, 36) = 12. That's how many bags you can make — 4 cookies and 3 brownies each, nothing left over.
Write out every factor of each number. Find what they share. Take the biggest.
Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
Common: 1, 2, 3, 4, 6, 12 → GCF = 12
Tedious. Falls apart fast when numbers get larger. But it builds intuition.
Break each number into primes. GCF is the product of shared prime factors.
GCF(360, 252)
Shared: and
More systematic. Still annoying for large numbers — factoring 3,654,921 by hand is not something anyone should do.
This one is 2,300 years old and still faster than anything else. The key insight: GCF(a, b) = GCF(b, a mod b). Keep replacing until the remainder hits zero.
GCF(360, 252) via Euclid
360 = 1 × 252 + 108
252 = 2 × 108 + 36
108 = 3 × 36 + 0
Remainder = 0 → GCF = 36 ✓
Three steps. Same answer. And it works just as fast on numbers with 200 digits.
RSA encryption — the math behind HTTPS, the padlock in your browser, every secure login — depends on a property that comes directly from GCF.
The setup: RSA works by finding two huge primes (each ~300 digits long) and multiplying them together. Anyone can see the product. Nobody can factor it back into the original primes in any reasonable timeframe.
The security comes from the fact that Euclid's algorithm is fast at finding GCF — but factoring large numbers is brutally slow. When you log into your bank, your browser and the server exchange public keys and use GCF-based operations to establish a shared secret. An eavesdropper who sees the traffic would need to factor a 600-digit number. Current estimates: longer than the age of the universe with every computer on Earth working on it.
Two numbers with GCF = 1 are called coprime. RSA encryption specifically requires that the public key exponent and a derived value called φ(n) are coprime — GCF = 1. The algorithm checks this using Euclid's method, same one you just used on 360 and 252.
Beyond fractions and cryptography:
Always 1. Primes have no factors other than 1 and themselves. Two different primes share only 1. GCF(7, 13) = 1. These are called coprime, or relatively prime.
No. GCF(a, b) ≤ the smaller of the two. If one divides the other evenly, GCF equals the smaller one: GCF(12, 36) = 12.
Apply Euclid's algorithm in pairs: GCF(a, b, c) = GCF(GCF(a, b), c). Find the first two, then take GCF of that result with the third. Works for any number of inputs.
Factor polynomials using GCF, difference of squares, and more with step-by-step solutions for algebra students.
Calculate modulo operations (a mod b) with step-by-step explanations. Perfect for programming and mathematics.
Perform long division with detailed step-by-step solutions. Learn the division algorithm with clear explanations.
Simplify fractions, radicals, and mathematical expressions with step-by-step solutions.