GCF Calculator

All steps are free — no sign-up, no paywall.

Integers separated by commas, or a polynomial · ≤2 of x/y/z/w/p/c/d · degree ≤4

Examples & math keys

Use ^ for powers; 5x works too. Limits: 220 characters and coefficient magnitude up to 1 trillion.

Worked example

GREATEST COMMON FACTOR
6

from 12, 18

✓ Checked

Show steps

Integers · Prime factorization + Euclidean algorithm

  1. Method 1: prime factorization

    12=2^2*3 18=2*3^2

    Break each nonzero magnitude into prime powers. The number 1 has no prime factors.

  2. Keep the shared prime powers

    GCF=2*3=6

    A common divisor can use only primes found in every nonzero number, with at most the smallest exponent. Multiplying those powers gives the greatest one.

  3. Method 2: Euclidean algorithm

    12=18*0+12 18=12*1+6 12=6*2+0 GCD(12,18)=6

    Replace each pair by the divisor and remainder; this preserves its common divisors. The last nonzero remainder is the GCD. Continue with each additional number.

  4. Check each original integer

    12=6*(2) 18=6*(3)

    Multiplying the GCF by each integer quotient recovers the original number. Both exact methods above establish that no larger positive common divisor exists. ✓

How to Find the Greatest Common Factor

For a list of integers, the greatest common factor is the largest positive number that divides every entry. Prime factorization finds it by keeping only shared primes with their lowest exponents. The Euclidean algorithm reaches the same result using division and remainders; the last nonzero remainder gives the GCD, another name for the GCF.

For polynomial terms, take the GCD of the integer coefficients and the lowest exponent of each variable across all terms. A missing variable counts as exponent zero. Multiply these common parts together, then divide every term by the GCF. Expanding the product checks the original expression.

Common mistakes

  • Choosing a factor that is too small: A common factor must also be the greatest. Use the full coefficient GCD, not just the first divisor you notice.
  • Using the highest exponent: Keep the lowest exponent present in every term. A larger power will not divide a term with a smaller one.
  • Ignoring a missing variable: Treat its exponent as zero. For example, x² + 1 has GCF 1 because the constant contains no x.
  • Losing signs when checking: The GCF is positive in its coefficient. Retain negative signs in the quotients and multiply back to check.

FAQ

How do you find the GCF of two or more numbers?

Enter integers separated by commas, such as 12, 18. The calculator shows both prime factorization and the Euclidean algorithm; for more numbers, it combines their GCDs successively.

How do you find the GCF of polynomial terms?

Take the GCD of the coefficients and the lowest power of each variable found in every term. For 32c²d + 4cd², the coefficient GCD is 4 and both minimum powers are 1, so the GCF is 4cd.

Can a GCF be 1 or include zero and negative inputs?

Yes: a GCF of 1 means there is no larger positive common factor. For integers, signs are ignored and zero does not restrict a nonzero common divisor; all-zero inputs receive a separate explanation.

Worked examples with steps

12, 18

GREATEST COMMON FACTOR
6

from 12, 18

✓ Checked

Show steps

Integers · Prime factorization + Euclidean algorithm

  1. Method 1: prime factorization

    12=2^2*3 18=2*3^2

    Break each nonzero magnitude into prime powers. The number 1 has no prime factors.

  2. Keep the shared prime powers

    GCF=2*3=6

    A common divisor can use only primes found in every nonzero number, with at most the smallest exponent. Multiplying those powers gives the greatest one.

  3. Method 2: Euclidean algorithm

    12=18*0+12 18=12*1+6 12=6*2+0 GCD(12,18)=6

    Replace each pair by the divisor and remainder; this preserves its common divisors. The last nonzero remainder is the GCD. Continue with each additional number.

  4. Check each original integer

    12=6*(2) 18=6*(3)

    Multiplying the GCF by each integer quotient recovers the original number. Both exact methods above establish that no larger positive common divisor exists. ✓

45, 30, 5

GREATEST COMMON FACTOR
5

from 45, 30, 5

✓ Checked

Show steps

Integers · Prime factorization + Euclidean algorithm

  1. Method 1: prime factorization

    45=3^2*5 30=2*3*5 5=5

    Break each nonzero magnitude into prime powers. The number 1 has no prime factors.

  2. Keep the shared prime powers

    GCF=5=5

    A common divisor can use only primes found in every nonzero number, with at most the smallest exponent. Multiplying those powers gives the greatest one.

  3. Method 2: Euclidean algorithm

    45=30*1+15 30=15*2+0 GCD(45,30)=15 15=5*3+0 GCD(15,5)=5

    Replace each pair by the divisor and remainder; this preserves its common divisors. The last nonzero remainder is the GCD. Continue with each additional number.

  4. Check each original integer

    45=5*(9) 30=5*(6) 5=5*(1)

    Multiplying the GCF by each integer quotient recovers the original number. Both exact methods above establish that no larger positive common divisor exists. ✓

45w^4+30w^3+5w^2

GREATEST COMMON FACTOR
5*w^2

from 45*w^4+30*w^3+5*w^2

✓ Checked

Show steps

Polynomial terms · Coefficient GCD + lowest variable powers

  1. Take the GCD of the coefficients

    GCD(45,30,5)=5

    Use the greatest positive integer that divides every coefficient. Signs stay in the remaining expression.

  2. Take the lowest power of each variable

    w: min(4,3,2)=2

    A variable belongs to the GCF only when every term contains it. A missing variable has exponent zero, so the minimum power is zero.

  3. Combine the common parts

    GCF=5*w^2

    Multiply the coefficient GCD by these minimum variable powers. Together they form the greatest common monomial.

  4. Divide every term by the GCF

    45*w^4+30*w^3+5*w^2=5*w^2*(9*w^2+6*w+1)

    Dividing every term by the same monomial leaves an equivalent product. This tool reports the GCF without factoring the remainder further.

  5. Check by expanding

    5*w^2*(9*w^2+6*w+1)=45*w^4+30*w^3+5*w^2

    Distributing the GCF over the remaining terms recovers every original coefficient and exponent. The coefficient GCD and minimum powers establish that it is greatest. ✓

32c^2d+4cd^2

GREATEST COMMON FACTOR
4*c*d

from 32*c^2*d+4*c*d^2

✓ Checked

Show steps

Polynomial terms · Coefficient GCD + lowest variable powers

  1. Take the GCD of the coefficients

    GCD(32,4)=4

    Use the greatest positive integer that divides every coefficient. Signs stay in the remaining expression.

  2. Take the lowest power of each variable

    c: min(2,1)=1 d: min(1,2)=1

    A variable belongs to the GCF only when every term contains it. A missing variable has exponent zero, so the minimum power is zero.

  3. Combine the common parts

    GCF=4*c*d

    Multiply the coefficient GCD by these minimum variable powers. Together they form the greatest common monomial.

  4. Divide every term by the GCF

    32*c^2*d+4*c*d^2=4*c*d*(8*c+d)

    Dividing every term by the same monomial leaves an equivalent product. This tool reports the GCF without factoring the remainder further.

  5. Check by expanding

    4*c*d*(8*c+d)=32*c^2*d+4*c*d^2

    Distributing the GCF over the remaining terms recovers every original coefficient and exponent. The coefficient GCD and minimum powers establish that it is greatest. ✓

x^2+1

GREATEST COMMON FACTOR
1

from x^2+1

The GCF is 1. These terms share no nontrivial common monomial.

✓ Checked

Show steps

Polynomial terms · Coefficient GCD + lowest variable powers

  1. Take the GCD of the coefficients

    GCD(1,1)=1

    Use the greatest positive integer that divides every coefficient. Signs stay in the remaining expression.

  2. Take the lowest power of each variable

    x: min(2,0)=0

    A variable belongs to the GCF only when every term contains it. A missing variable has exponent zero, so the minimum power is zero.

  3. Combine the common parts

    GCF=1

    Multiply the coefficient GCD by these minimum variable powers. Together they form the greatest common monomial.

  4. Divide every term by the GCF

    x^2+1=1*(x^2+1)

    Dividing every term by the same monomial leaves an equivalent product. This tool reports the GCF without factoring the remainder further.

  5. Check by expanding

    1*(x^2+1)=x^2+1

    Distributing the GCF over the remaining terms recovers every original coefficient and exponent. The coefficient GCD and minimum powers establish that it is greatest. ✓