Factoring Calculator

Greatest Common Factor Solver

Find the GCF of any two whole numbers, with step-by-step solutions in two methods.

    How to Find the Greatest Common Factor

    The greatest common factor (GCF) — also called the greatest common divisor (GCD) — of two numbers is the largest number that divides both of them exactly. There are three standard ways to find it:

    Listing factors. Write out every factor of each number and take the largest one the two lists share. This works well for small numbers: the factors of 18 are 1, 2, 3, 6, 9, 18; the factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24, 48; the largest shared factor is 6.

    Prime factorization. Break each number into primes and multiply the primes they share, each at its lowest power. This is the method most algebra courses expect you to show.

    The Euclidean algorithm. Divide the larger number by the smaller one, then keep dividing the previous divisor by the remainder. The last non-zero remainder is the GCF. It is the fastest method by hand once the numbers get large.

    The GCF is also the first step of factoring polynomials: you pull out the GCF of the coefficients together with the lowest power of the variable. The factoring calculator applies this step automatically before any other method.

    Prime Factorization Method

    Find the GCF of 48 and 18. First write each number as a product of primes: 48 = 2⁴ × 3, and 18 = 2 × 3². Then take every prime that appears in both factorizations, at the lowest power it has in either one. Both numbers contain a 2 (at powers 2⁴ and 2¹, so take 2¹) and a 3 (at powers 3¹ and 3², so take 3¹). Multiply them: GCF(48, 18) = 2 × 3 = 6.

    Check it against the listing method above — same answer, but prime factorization scales to numbers like 1,000,000 where listing every factor would be painful.

    GCF Examples

    NumbersShared prime factorsGCF
    12 and 182 × 36
    24 and 362² × 312
    35 and 6377
    48 and 182 × 36

    Frequently Asked Questions

    What is the greatest common factor (GCF)?

    The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest positive integer that divides two or more numbers with no remainder. For example, GCF(48, 18) = 6, because 6 is the largest number that divides both 48 and 18 exactly.

    How do you find the GCF of two numbers?

    List the factors of each number and take the largest one they share; or break both numbers into prime factors and multiply the common primes at their lowest powers; or run the Euclidean algorithm — divide, replace the pair with the divisor and remainder, and repeat until the remainder is 0. The last non-zero divisor is the GCF.

    What is the difference between the GCF and the LCM?

    The GCF is the largest number that divides both numbers; the LCM is the smallest number that both numbers divide. For two numbers they are linked: GCF × LCM equals the product of the numbers. For 12 and 18: GCF = 6, LCM = 36, and 6 × 36 = 216 = 12 × 18.

    How is the GCF used to factor polynomials?

    The GCF of a polynomial is the largest factor shared by every term — the GCF of the coefficients times the lowest power of each variable. Factoring always starts by pulling it out: 6x² + 9x = 3x(2x + 3). A factoring calculator applies this step automatically before trying trinomial or grouping methods.