GCF calculator
Find the greatest common factor of any set of whole numbers, with the prime factors shown.
Two or more whole numbers, separated by commas or spaces.
GCF of 48, 180
12
- Least common multiple
- 720
- Coprime?
- No
| Number | Prime factorization |
|---|---|
| 48 | 2^4 × 3 |
| 180 | 2^2 × 3^2 × 5 |
How to use the gcf calculator
- Enter two or more whole numbers separated by commas or spaces.
- Read the GCF and the prime factorization of each number.
About this calculator
The greatest common factor is the largest whole number that divides every number in a set without a remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF).
You need it to simplify fractions and ratios. The calculator uses Euclid’s algorithm for the answer and shows the prime factorization of each number so you can see why.
Euclid’s algorithm
gcf(a, b) = gcf(b, a mod b), gcf(a, 0) = a
For more than two numbers, apply it pairwise: gcf(a, b, c) = gcf(gcf(a, b), c). Via prime factors, the GCF is the product of shared primes at their lowest power.
Example
48 = 2⁴ × 3 and 180 = 2² × 3² × 5. Shared primes at their lowest powers are 2² and 3, so GCF = 4 × 3 = 12.
Frequently asked questions
What is the GCF of two prime numbers?
Always 1, because primes have no factors other than 1 and themselves. Numbers with GCF 1 are called coprime.
Is GCF the same as GCD and HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
How is GCF used to simplify fractions?
Divide the numerator and denominator by their GCF. 18/24 has GCF 6, so it simplifies to 3/4.
What is the relationship between GCF and LCM?
For two numbers, GCF × LCM = a × b. So once you know one, you can compute the other.