GCF Calculator
: Find the greatest common factor of two or more numbers or fractions, with the prime factorization, every common factor and Euclid's steps- GCF (greatest common factor)
- 12
- LCM (least common multiple)
- 360
- Numbers
- 24, 36, 60
- Common factors (6)
- 1, 2, 3, 4, 6, 12
- Every number that divides all of them: the factors of the GCF.
| Number | Prime factors |
|---|---|
| 24 | 2³ × 3 |
| 36 | 2² × 3² |
| 60 | 2² × 3 × 5 |
| Prime | 24 | 36 | 60 | GCF | LCM |
|---|---|---|---|---|---|
| 2 | 3 | 2 | 2 | 2² | 2³ |
| 3 | 1 | 2 | 1 | 3 | 3² |
| 5 | 0 | 0 | 1 | — | 5 |
| Step: a = q × b + r |
|---|
| 36 = 1 × 24 + 12 |
| 24 = 2 × 12 + 0 |
| 60 = 5 × 12 + 0 |
GCF Calculator
The greatest common factor (GCF) is the largest whole number that divides every number in a list without a remainder; it is also called the greatest common divisor (GCD) or highest common factor (HCF). This GCF calculator finds it for two or more numbers or fractions, and shows how: the prime factorization of each number, every common factor, and the steps of Euclid's algorithm. It gives the least common multiple (LCM) as well, and runs in your browser, so nothing you type is sent anywhere.
How to find the greatest common factor
- Type two or more numbers in
Numbers, separated by commas or spaces, such as24, 36, 60. Fractions such as2/3work too. - Read the GCF at the top, the LCM under it and the list of common factors.
- Check the working in the tables: each number's prime factorization, the lowest power of each shared prime, and Euclid's division steps.
- Use
Copy all, orDownloadfor a CSV or text file with the figures and tables.
Example
The GCF of 24, 36 and 60 by prime factorization: keep each prime the numbers share, at its lowest power.
24, 36, 6024 = 2³ × 3
36 = 2² × 3²
60 = 2² × 3 × 5
Shared primes at their lowest power: 2² × 3
GCF = 12
Common factors: 1, 2, 3, 4, 6, 12
LCM = 360Details
- Prime factorization method: split each number into primes and multiply the primes they all share, each at the lowest power that appears. For 24, 36 and 60 that is 2² × 3 = 12.
- Euclid's algorithm: divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and the remainder until the remainder is 0; the last divisor is the GCF. For 1071 and 462 it takes 3 steps and ends at 21. For three or more numbers, the GCF of the first two is taken with the third, and so on.
- The common factors are every number that divides all of the inputs; they are exactly the factors of the GCF, so the list always ends with the GCF itself.
- GCF of fractions: the GCF of the numerators over the LCM of the denominators, after putting each fraction in lowest terms. For 2/3 and 4/9 that is 2/9.
- A GCF of 1 means the numbers share no prime factor (they are coprime). Negative numbers count as their absolute value, and 0 is ignored, since every number divides 0.
Limits
- Whole numbers and fractions only, up to 100 numbers of up to 60 digits each. Decimals such as 1.5 are refused; write them as fractions (3/2).
- Prime factorizations and common factors are shown for numbers up to 10¹⁸; above that the GCF and LCM are still exact, from Euclid's algorithm.
- The common factor list is left out when the GCF has more than 2,000 factors, and the prime power table when there are more than 8 numbers.
- Numbers, not algebra: it does not factor the GCF out of a polynomial such as 6x² + 9x.
FAQ
How do you find the GCF of two numbers?
List the prime factors of both and multiply the ones they share: 48 = 2⁴ × 3 and 180 = 2² × 3² × 5 share 2² × 3, so the GCF is 12. For big numbers Euclid's algorithm is faster: divide, keep the remainder, repeat until it is 0.
Is the GCF the same as the GCD and the HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
What is the GCF of 8 and 9?
1. 8 = 2³ and 9 = 3² share no prime, so their only common factor is 1 and they are called coprime, or relatively prime.
How are the GCF and LCM related?
For two numbers, GCF × LCM = the product of the numbers. For 12 and 18: 6 × 36 = 216 = 12 × 18. This does not hold for three or more numbers.
Can the GCF be bigger than the smallest number?
No. The GCF divides every number, so it is at most the smallest one (ignoring 0); it equals the smallest number when that number divides all the others, as with 6, 12 and 18.
Runs entirely in your browser. Nothing is uploaded.