Find the Greatest Common Factor (GCF) of two or more numbers instantly with step-by-step prime factorization.
Enter two or more numbers separated by commas to find their Greatest Common Factor.
The greatest common factor (GCF), also called the greatest common divisor, is the largest whole number that divides evenly into two or more numbers. For 24 and 36, the GCF is 12. It is the tool that simplifies fractions, reduces ratios and solves practical division problems where things must come out in whole units.
Write out every factor of each number and pick the largest they share. It is reliable and intuitive, but it becomes impractical above about two digits.
Break each number into its prime factors, then multiply the primes they have in common. This also shows the structure of the numbers, which helps when working with fractions.
The fastest method, and over two thousand years old. It appears in Euclid's Elements from around 300 BC and is still the algorithm computers use today.
Method 1: Listing factors
Method 2: Prime factorisation
Method 3: Euclidean algorithm
The GCF is 12 by all three methods, but Euclid's takes two steps instead of twenty
For 48 and 60 the difference is minor. For 1,071 and 462 it is decisive: listing factors means testing hundreds of candidates, while the Euclidean algorithm reaches the answer in three divisions.
The GCF is 21, found in three steps
| Application | How GCF Is Used |
|---|---|
| Simplifying fractions | Divide numerator and denominator by their GCF |
| Reducing ratios | Divide every part by the GCF |
| Equal grouping problems | Largest identical groups from different quantities |
| Tiling and cutting | Largest square tile that fits a rectangle exactly |
| Cryptography | Underpins RSA key generation and modular arithmetic |
You have 48 pens and 60 notebooks and want to make identical gift bags with nothing left over. What is the largest number of bags?
12 bags, each with 4 pens and 5 notebooks
For any two numbers, GCF multiplied by LCM equals the product of the numbers themselves. For 48 and 60: GCF is 12, LCM is 240, and 12 times 240 equals 2,880, which is 48 times 60. Finding one gives you the other for free.
The GCF and LCM (Least Common Multiple) are related but opposite concepts. The GCF finds the largest shared divisor, while the LCM finds the smallest shared multiple. There's a useful relationship between them:
For instance, GCF(12, 18) = 6 and LCM(12, 18) = 36. Verification: 6 × 36 = 216 = 12 × 18 ✓. This property is extensively covered in the Purplemath GCF guide.
The GCF of 1 and any number is always 1, since 1 is the only positive integer that divides 1.
Only if they are the same prime number. Two different prime numbers always have a GCF of 1 because prime numbers have no common factors other than 1. Such numbers are called coprime or relatively prime.
To simplify a fraction, divide both the numerator and denominator by their GCF. For example, to simplify 24/36: GCF(24,36) = 12, so 24/36 = (24÷12)/(36÷12) = 2/3.
They are all the same thing! GCF (Greatest Common Factor), GCD (Greatest Common Divisor), and HCF (Highest Common Factor) all refer to the largest number that divides two or more numbers without a remainder. Different countries and textbooks use different terms.
The greatest common factor of two or more numbers is the largest whole number that divides all of them without leaving a remainder. For 24 and 36 it is 12, because 12 divides both evenly and no larger number does.
The Euclidean algorithm. Divide the larger number by the smaller, keep the remainder, then repeat with the smaller number and that remainder until the remainder is zero. The last non-zero remainder is the GCF. It is dramatically faster than listing factors for large numbers.
The numbers are coprime, or relatively prime, meaning they share no common factor other than one. Fifteen and twenty-eight are coprime even though neither is a prime number. A fraction whose numerator and denominator are coprime is already in lowest terms.
Find the GCF of the first two, then find the GCF of that result and the third number, and so on. The order does not matter, and you can always work pairwise regardless of how many numbers there are.
This calculator is provided for educational purposes.