Use this free GCF calculator to find the greatest common factor, also called the greatest common divisor (GCD) or highest common factor (HCF), of two to ten whole numbers. It shows the working three ways: listing the factors, prime factorization and Euclid's algorithm. It also gives the LCM, the common factors, whether the numbers are coprime, and each number divided by the GCF. The Factor Out the GCF tab takes an expression such as 12x³ + 18x² − 24x and gives 6x(2x² + 3x − 4), or finds the GCF of monomials like 12x³y and 18x²y². Tables list the GCF of the most common pairs, the other names for the GCF and which method to use. It is free and instant, and your numbers stay in your browser.
What is the greatest common factor?
The greatest common factor (GCF) of two or more whole numbers is the biggest number that divides all of them exactly, with nothing left over. The factors of 24 are 1, 2, 3, 4, 6, 8, 12 and 24, and the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18 and 36. The numbers on both lists are the common factors, and the biggest of them, 12, is the GCF. You will also see it called the greatest common divisor (GCD) or the highest common factor (HCF). They are the same number.
Method 1: list the factors
Write down every factor of each number, circle the ones that appear on every list, and pick the biggest. For 24, 36 and 60 the common factors are 1, 2, 3, 4, 6 and 12, so the GCF is 12. This is easy to see and good for small numbers, but the lists get long fast, so the calculator draws them only for numbers up to 100,000.
Method 2: prime factorization
Break each number into primes: 24 = 2³ × 3, 36 = 2² × 3² and 60 = 2² × 3 × 5. Then take each prime the fewest times it appears in any of them: 2 appears at least twice and 3 at least once, and 5 is missing from the others. So the GCF is 2² × 3 = 12. The same primes give the LCM if you take each one the most times instead.
Method 3: Euclid's algorithm
Divide the bigger number by the smaller one and keep the remainder. Then repeat with the smaller number and the remainder, until the remainder is 0. The last non-zero remainder is the GCF. For 84 and 126: 126 = 1 × 84 + 42, then 84 = 2 × 42 + 0, so the GCF is 42. It needs no factoring, so it works on huge numbers: it finds that the GCF of 268,442 and 178,296 is 2 in a handful of steps.
The GCF of three or more numbers
Find the GCF of the first two, then the GCF of that answer and the next number, and so on. For 36, 48 and 60: GCF(36, 48) = 12, and GCF(12, 60) = 12, so the GCF of all three is 12. The calculator takes up to ten numbers at once and shows each step.
GCF and LCM
For two numbers, GCF × LCM = the product of the numbers. For 24 and 36, the GCF is 12 and the LCM is 72, and 12 × 72 = 864 = 24 × 36. So once you have the GCF, LCM = a × b ÷ GCF. The calculator shows the LCM beside the GCF for this reason, and the LCM Calculator finds it four ways.
Coprime numbers
Two numbers whose GCF is 1 are called coprime (or relatively prime): they share no factor except 1. 14 and 25 are coprime, even though neither of them is a prime number. The calculator tells you when your numbers are coprime.
Simplifying a fraction with the GCF
Divide the top and the bottom by their GCF to get the simplest form in one step. For 18/24 the GCF is 6, so 18/24 = 3/4. The "Numbers ÷ GCF" card does this sum for you. The Fraction Calculator simplifies whole fractions and mixed numbers.
Factoring out the GCF of an expression
In algebra, factoring out the GCF means pulling the biggest common factor out of every term. For 12x³ + 18x² − 24x, the coefficients 12, 18 and 24 have GCF 6, and every term has at least one x, so the common factor is 6x. Divide each term by it and the expression becomes 6x(2x² + 3x − 4). Multiply it back out to check: 6x × 2x² = 12x³, 6x × 3x = 18x² and 6x × (−4) = −24x. The Factor Out the GCF tab does this, and it also finds the GCF of separate monomials such as 12x³y and 18x²y², which is 6x²y.
Zero and negative numbers
Every number divides 0, so GCF(a, 0) = a: GCF(0, 15) = 15. The GCF of 0 and 0 is not defined, because there is no biggest number that divides 0. For negative numbers the calculator uses the absolute value, so GCF(−12, 18) = 6.
A real use: cutting squares
A 24 cm by 36 cm sheet can be cut into equal squares with no waste. The biggest square has a side equal to the GCF of 24 and 36, which is 12 cm, so you get 2 × 3 = 6 squares. To list all the factors of a single number instead, use the Factor Calculator.

