What is the Greatest Common Factor?

The greatest common factor is the largest positive integer that divides evenly into two or more numbers without leaving a remainder. It goes by several names in mathematics: greatest common divisor (GCD), highest common factor (HCF), or highest common divisor (HCD). The concept is fundamental to number theory and algebra.

For example, the factors of 12 are 1, 2, 3, 4, 6, and 12. The factors of 18 are 1, 2, 3, 6, 9, and 18. The common factors are 1, 2, 3, and 6, making 6 the greatest common factor.

Understanding GCF matters for:

  • Simplifying fractions to their lowest terms
  • Factoring polynomials in algebra
  • Finding common denominators
  • Solving real-world problems involving ratios and proportions

How to Find the GCF: Prime Factorization Method

Prime factorization breaks down each number into its prime components, then multiplies the shared primes together. This method reveals the underlying structure and is especially useful for larger numbers.

For 30 and 54:

30 = 2 × 3 × 5

54 = 2 × 3 × 3 × 3

GCF = 2 × 3 = 6

  • Prime factors — The prime numbers that multiply to give the original number

Other Methods: Euclidean Algorithm and Beyond

The Euclidean algorithm uses repeated division: divide the larger number by the smaller, then divide the smaller by the remainder, continuing until the remainder is zero. The last non-zero remainder is the GCF.

Example with 24 and 36:

  • 36 ÷ 24 = 1 remainder 12
  • 24 ÷ 12 = 2 remainder 0
  • GCF = 12

The factor listing method works best for smaller numbers: list all factors of each number, then identify the largest one appearing in every list. For 8 and 12, the common factors are 1, 2, and 4, so the GCF is 4.

The binary algorithm (Stein's algorithm) avoids modulo operations and uses only subtraction and division by 2, making it efficient for computer calculations.

GCF for Multiple Numbers and Special Cases

When finding the GCF of three or more numbers, the same methods apply. Factor each number, identify all primes present in every factorization, and multiply them together. You can also find the GCF of the first two numbers, then find the GCF of that result with the third number, and so on.

Coprime numbers are integers with a GCF of 1 (meaning they share no prime factors). For instance, 15 and 28 are coprime because 15 = 3 × 5 and 28 = 2 × 2 × 7 have no primes in common.

A useful relationship links GCF and LCM: GCF(a, b) × LCM(a, b) = a × b. This identity lets you calculate one if you know the other.

Common Pitfalls and Practical Tips

Avoid these mistakes when calculating the GCF by hand or interpreting results.

  1. Don't forget about 1 — The number 1 is a factor of every integer, but it's rarely the GCF unless the numbers are coprime. Always compare all common factors, not just prime ones, to ensure you've found the largest.
  2. Watch signs and zero — GCF is defined for positive integers only. If your input includes negative numbers, work with their absolute values. Zero is divisible by any non-zero number, so GCF(n, 0) = n.
  3. Verify with division — Once you've calculated the GCF, confirm it by dividing each original number by the result. All quotients should be whole numbers with no remainder—this is your sanity check.
  4. Choose the right method for scale — For small numbers (under 100), factor listing is quick and intuitive. For larger numbers, prime factorization or the Euclidean algorithm is faster and less error-prone than manually listing every factor.

Frequently Asked Questions

What is the GCF of 14 and 42?

The GCF of 14 and 42 is 14. List the factors of each: 14 has factors 1, 2, 7, 14 while 42 has factors 1, 2, 3, 6, 7, 14, 21, 42. The largest number appearing in both lists is 14. This makes sense because 42 ÷ 14 = 3 exactly—so 14 divides 42 evenly, and no number larger than 14 can divide both.

How do I find the GCF of 8 and 12?

The GCF of 8 and 12 is 4. Listing factors: 8 = {1, 2, 4, 8} and 12 = {1, 2, 3, 4, 6, 12}. The common factors are 1, 2, and 4, with 4 being the largest. You can verify: 8 ÷ 4 = 2 and 12 ÷ 4 = 3, both whole numbers with no common factors themselves.

What's the GCF of 24 and 36?

The GCF of 24 and 36 is 12. Using the Euclidean algorithm: 36 mod 24 = 12, then 24 mod 12 = 0, so 12 is the GCF. Alternatively, prime factorization shows 24 = 2³ × 3 and 36 = 2² × 3². The shared prime factors are 2² and 3¹, giving 4 × 3 = 12.

Can the GCF be larger than the smallest number in the set?

No. The GCF cannot exceed the smallest number because any common divisor must divide every number in the set, including the smallest. If the smallest number is 20, the GCF is at most 20 (when all other numbers are multiples of 20). This property is useful for quick mental checks of your answer.

What does it mean if two numbers are coprime?

Two numbers are coprime when their GCF equals 1, indicating they share no prime factors. For example, 9 and 14 are coprime: 9 = 3² and 14 = 2 × 7 have no primes in common. Coprime numbers are important in cryptography, fraction simplification, and number theory. Not all coprime pairs include prime numbers themselves.

How does GCF relate to the least common multiple (LCM)?

The GCF and LCM are connected by the formula: GCF(a, b) × LCM(a, b) = a × b. For instance, GCF(12, 18) = 6 and LCM(12, 18) = 36, so 6 × 36 = 216 = 12 × 18. This relationship lets you find the LCM if you already know the GCF, or vice versa, without recalculating from scratch.

More math calculators (see all)