GCF Calculator
Find the greatest common factor (GCF) of two or more whole numbers. Enter the numbers to see the GCF, the prime factorization of each one, and their least common multiple.
Greatest common factor (GCF)
6
Check the highlighted fields to see your result.
- Least common multiple (LCM)
- 180
Prime factorization
- 12 = 2² × 3
- 18 = 2 × 3²
- 30 = 2 × 3 × 5
Results are estimates for information only and do not constitute financial, medical, or legal advice.
How to find the GCF
One way is to break each number into prime factors and multiply the primes they all share, each with its smallest power. The calculator uses the Euclidean algorithm, which is much faster for large numbers: replace the larger number with the remainder of dividing it by the smaller one, and repeat until the remainder is 0.
The formula
GCF(a, b) = GCF(b, a mod b), until the remainder is 0
Worked example
Find the GCF of 12, 18, and 30.
- 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5.
- The primes all three share are 2 and 3, each to the power of 1.
- GCF = 2 × 3 = 6.
Frequently asked questions
Are GCF, GCD, and HCF the same thing?
Yes. Greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) are three names for the same number: the largest whole number that divides all the numbers without a remainder.
What is the GCF used for?
The most common use is simplifying fractions: dividing the top and bottom by their GCF gives the simplest form. It also helps split things into equal groups, like cutting two ribbons into the longest equal pieces.
What if the GCF is 1?
Then the numbers have no common factor other than 1. They are called relatively prime or coprime, like 8 and 9. A fraction made of coprime numbers is already in its simplest form.