Skip to content

Greatest Common Factor (GCF)

The Greatest Common Factor (GCF) or Greatest Common Divisor (GCD) of two non-zero integers is the largest positive integer that divides both numbers without remainder.

Example #1:

GCF(6, 18) = ?

Solution #1:

Factors of 6:  1, 2, 3, 6
Factors of 18:  1, 2, 3, 6, 18

The largest factor common to both numbers is 6
GCF(6, 18) = 6

Example #2:

GCF(18, 4) = ?

Solution #2:

(The negative number sign may be ignored as divisibility is not affected)

Factors of 18:  1, 2, 3, 6, 18
Factors of 4:  1, 2, 4

The largest factor common to both numbers is 2
GCF(18, 4) = 2


  • Every common divisor of a and b is a divisor of GCF(ab).
  • GCF(ab), where a and b are not both zero, may be defined alternatively and equivalently as the smallest positive integer d which can be written in the form d = a·p + b·q where p and q are integers.
  • GCF(a, 0) = |a|, for a ≠ 0, since any number is a divisor of 0, and the greatest divisor of a is |a|.
  • If a divides the product b·c, and GCF(ab) = d, then a/d divides c.
  • If m is a non-negative integer, then GCF(m·am·b) = m·GCF(ab).
  • If m is any integer, then GCF(a + m·bb) = GCF(ab). If m is a nonzero common divisor of a and b, then GCF(a/mb/m) = GCF(ab)/m.
  • The GCF is a multiplicative function in the following sense: if a1 and a2 are relatively prime, then GCF(a1·a2b) = GCF(a1b)·GCF(a2b).
  • The GCF is a commutative function: GCF(a, b) = GCF(b, a).
  • The GCF is an associative function: GCF(a, GCF(b, c)) = GCF(GCF(a, b), c).
  • The GCF of three numbers can be computed as GCF(abc) = GCF(GCF(ab), c), or in some different way by applying commutativity and associativity. This can be extended to any number of numbers.
  • GCF(ab) is closely related to the Least Common Multiple LCM(ab): we have
GCF(ab)·LCM(ab) = a·b   (This formula is often used to compute least common multiples)

Related Topic: