GCF Calculator
Enter two to ten whole numbers to find their greatest common factor, with every factor listed and a prime-factor check.
Inputs
Greatest common factor
12
The largest number that divides both 24 and 36 with no remainder.
- Least common multiple
- 72
- Common factors
- 1, 2, 3, 4, 6, 12
- Fraction in lowest terms
- 2/3
- Ratio in lowest terms
- 2 : 3
Step-by-step solution
List the factors of each number.
24: 1, 2, 3, 4, 6, 8, 12, 24 · 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
Find the factors that appear in every list.
Common factors: 1, 2, 3, 4, 6, 12
The greatest of the common factors is the GCF.
GCF = 12
Check with prime factors: break each number into primes.
24 = 2³ × 3, 36 = 2² × 3²
Multiply the primes that every number has, each to the lowest power it appears with.
GCF = 2² × 3 = 4 × 3 = 12
Check: for two numbers, the GCF times the LCM equals the product of the numbers.
12 × 72 = 864 = 24 × 36
Formulas used
GCF = the largest number that divides every input listing factors
GCF = product of the lowest power of each shared prime prime factorisation
GCF(a, b) × LCM(a, b) = a × b for two numbers
- a, b
- the whole numbers you entered
- GCF
- the greatest common factor, the largest number that divides all of them
- LCM
- the least common multiple, the smallest number all of them divide into
A factor of a number divides it 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. A common factor appears in both lists, and the greatest of those, 12, is the GCF.
Prime factors give the same answer and show why it works. 24 = 2³ × 3 and 36 = 2² × 3². A number divides both only if it uses no more than two 2s (the most 36 allows) and no more than one 3 (the most 24 allows). The biggest such number takes the lowest power of each shared prime, 2² × 3 = 12. This is the mirror image of the LCM, which takes the highest power of every prime.
Every common factor of the numbers is also a factor of the GCF. Here the common factors 1, 2, 3, 4, 6 and 12 are exactly the factors of 12, which is why the calculator can list them from the GCF alone.
Worked example: the GCF of 24 and 36
Numbers a = 24 and b = 36.
24: 1, 2, 3, 4, 6, 8, 12, 24
36: 1, 2, 3, 4, 6, 9, 12, 18, 36
Common factors: 1, 2, 3, 4, 6, 12 → GCF = 12
Check: 24 = 2³ × 3 and 36 = 2² × 3², so GCF = 2² × 3 = 12
A real use: you have 24 apples and 36 oranges and want identical gift baskets with nothing left over. The most baskets you can make is the GCF, 12, with 2 apples and 3 oranges in each. The ratio 24 : 36 simplifies to 2 : 3 for the same reason.
GCF of common pairs of numbers
The last column divides each number by the GCF, giving the simplest whole-number ratio. When that ratio's numbers share nothing, the GCF is as large as it can be.
| Numbers | GCF | LCM | Ratio in lowest terms |
|---|---|---|---|
| 8, 12 | 4 | 24 | 2 : 3 |
| 12, 18 | 6 | 36 | 2 : 3 |
| 15, 25 | 5 | 75 | 3 : 5 |
| 16, 24 | 8 | 48 | 2 : 3 |
| 18, 27 | 9 | 54 | 2 : 3 |
| 20, 30 | 10 | 60 | 2 : 3 |
| 21, 35 | 7 | 105 | 3 : 5 |
| 24, 36 | 12 | 72 | 2 : 3 |
| 28, 42 | 14 | 84 | 2 : 3 |
| 36, 48 | 12 | 144 | 3 : 4 |
| 9, 28 | 1 | 252 | 9 : 28 |
GCF of common groups of three
The GCF of three numbers can be much smaller than the GCF of any two of them. 6, 10 and 15 are an example: each pair shares a factor, but all three share only 1.
| Numbers | GCF | LCM | Ratio in lowest terms |
|---|---|---|---|
| 12, 18, 24 | 6 | 72 | 2 : 3 : 4 |
| 8, 12, 20 | 4 | 120 | 2 : 3 : 5 |
| 18, 24, 42 | 6 | 504 | 3 : 4 : 7 |
| 16, 40, 56 | 8 | 560 | 2 : 5 : 7 |
| 30, 45, 60 | 15 | 180 | 2 : 3 : 4 |
| 6, 10, 15 | 1 | 30 | 6 : 10 : 15 |
Frequently asked questions
What does GCF stand for, and is it the same as HCF and GCD?
GCF is the greatest common factor: the largest whole number that divides every number you give it with no remainder. HCF (highest common factor) and GCD (greatest common divisor) are other names for exactly the same thing. GCF is common in US schools, HCF in the UK and India, and GCD in number theory and programming.
How do I find the GCF by listing factors?
Write out every factor of each number, circle the ones that appear in all the lists, and take the biggest. For 24 and 36 the shared factors are 1, 2, 3, 4, 6 and 12, so the GCF is 12. It is quick for small numbers. For large ones, the HCF calculator on this site uses a faster division method.
What is the difference between the GCF and the LCM?
The GCF is the largest number that divides into all of yours, and it is never bigger than the smallest of them. The LCM is the smallest number that all of yours divide into, and it is never smaller than the largest. For 24 and 36 the GCF is 12 and the LCM is 72. For two numbers, GCF × LCM = a × b, and 12 × 72 = 864 = 24 × 36.
How do I use the GCF to simplify a fraction?
Divide the top and bottom by their GCF and the fraction is in lowest terms. For 18/24 the GCF is 6, so 18/24 = 3/4. The calculator shows this as "Fraction in lowest terms" for any two numbers, and as a ratio, so it also simplifies 18 : 24 to 3 : 4.
What if the GCF is 1?
Then the numbers are coprime (also called relatively prime): they share no factor other than 1. 8 and 15 are coprime even though neither is prime. A fraction whose top and bottom are coprime is already in lowest terms, and the LCM of coprime numbers is simply their product.
How do I find the GCF of three or more numbers?
List the factors of every number and keep the ones common to all, or use prime factors and take the lowest power of each prime that every number contains. For 12, 18 and 30 the shared prime factors are one 2 and one 3, so the GCF is 6. Three numbers can have a GCF of 1 even when each pair shares a factor: 6, 10 and 15 are an example.
What is the GCF of a number and itself, or of a number and 1?
The GCF of a number and itself is that number: GCF(9, 9) = 9. The GCF of any number and 1 is 1, because 1 is the only factor 1 has. If one number divides the other, the smaller one is the GCF, so GCF(7, 28) = 7.
Can I use zero or negative numbers?
This calculator takes positive whole numbers only. Every number divides 0, so including 0 tells you nothing: GCF(0, n) is just n. For negative numbers the convention is to ignore the sign and use the positive values.