What is the greatest common factor?
The greatest common factor of a set of whole numbers is the largest number that divides all of them with no remainder. The factors of 12 are 1, 2, 3, 4, 6 and 12, and the factors of 18 are 1, 2, 3, 6, 9 and 18. The factors they share are 1, 2, 3 and 6, so the GCF of 12 and 18 is 6. You will also see it called the greatest common divisor (GCD) or the highest common factor (HCF); all three names mean the same thing. Every common factor of a set of numbers is also a factor of their GCF, which is why the calculator can list all of them from the GCF alone.
Method 1: prime factorization
Break each number into prime factors, then multiply the primes that appear in every number, each raised to the lowest power it has in any of them. For 48, 180 and 600: 48 = 2⁴ × 3, 180 = 2² × 3² × 5, and 600 = 2³ × 3 × 5². The primes common to all three are 2 and 3. The lowest power of 2 is 2² and the lowest power of 3 is 3¹, so the GCF is 2² × 3 = 12. The prime 5 is left out because 48 does not contain it. This method is easy to follow by hand for small numbers and shows clearly why the answer is what it is.
Method 2: the Euclidean algorithm
For larger numbers, factoring gets slow, but Euclid’s algorithm stays fast. Divide the larger number by the smaller one and keep the remainder. Then divide the smaller number by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF. For 1071 and 462: 1071 = 2 × 462 + 147, then 462 = 3 × 147 + 21, then 147 = 7 × 21 + 0, so the GCF is 21. With three or more numbers, find the GCF of the first two, then the GCF of that result and the next number, and so on. This calculator uses exact big-integer arithmetic, so it works for numbers with dozens of digits without rounding errors.
Where the GCF is useful
The most common use is simplifying fractions: divide the top and bottom by their GCF to get lowest terms in one step, so 48/180 becomes 4/15 after dividing both by 12. The same idea simplifies ratios, which you can do with the ratio calculator. The GCF also answers practical questions, such as the largest square tile that fits a 48 by 180 inch floor exactly, or the greatest number of identical gift bags you can make from 84 pencils, 126 erasers and 210 stickers (42 bags). Numbers whose GCF is 1, like 35 and 64, are called coprime or relatively prime: they share no prime factors at all, even though neither has to be prime itself.
GCF and LCM together
The GCF is closely linked to the least common multiple. For any two positive integers, GCF × LCM equals the product of the numbers: for 12 and 18, 6 × 36 = 216 = 12 × 18. That makes it quick to find one from the other. To find the smallest number that two or more numbers all divide into, such as a common denominator, use the LCM calculator. A few edge cases: negative numbers have the same GCF as their absolute values, the GCF of any number and 0 is the number itself, and the GCF of 0 and 0 is undefined.