GCF Calculator
The greatest common factor is the biggest number that divides them all. Here's 12 and 18.
- Euclid's algorithm
- 2 to 20 numbers
- Updated Nov 2, 2026
- Factors of 121, 2, 3, 4, 6, 12
- Factors of 181, 2, 3, 6, 9, 18
- Largest shared6
Use this GCF calculator to find the greatest common factor of two or more whole numbers. The GCF is the largest number that divides evenly into every number in your list: the GCF of 12 and 18 is 6, because 6 is the biggest number in both lists of factors. Enter your numbers to see the answer with steps.
How to Find the GCF
The greatest common factor of two or more numbers is the largest number that is a factor of all of them (OpenStax Elementary Algebra 2e, 7.1). Here are three ways to find it, all shown by the calculator.
Method 1: List the factors
- List the factors of each number. Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18.
- Find the largest number in every list. That's 6.
Method 2: Use prime factorization
- Write each number as a product of primes: 12 = 2² × 3 and 18 = 2 × 3².
- Keep only the primes they share, at the lowest power each appears: 2 and 3.
- Multiply: 2 × 3 = 6.
Method 3: Euclid's algorithm
Divide the larger number by the smaller, then divide the smaller number by the remainder, and repeat until the remainder is 0. The last nonzero remainder is the GCF:
18 = 1 × 12 + 6 → 12 = 2 × 6 + 0 → GCF = 6Euclid's algorithm is the fastest method for big numbers, because it never needs to factor them. For 1,071 and 462: 1,071 = 2 × 462 + 147, then 462 = 3 × 147 + 21, then 147 = 7 × 21 + 0, so the GCF is 21.
GCF of Three or More Numbers
Find the GCF of the first two numbers, then the GCF of that result and the next number. For 24, 36, and 60: GCF(24, 36) = 12, then GCF(12, 60) = 12. With prime factors: 24 = 2³ × 3, 36 = 2² × 3², and 60 = 2² × 3 × 5 share 2² × 3 = 12.
Using the GCF to Simplify Fractions
To reduce a fraction to lowest terms, divide the top and bottom by their GCF. For 18/24, GCF(18, 24) = 6, so 18/24 = 3/4. If the GCF is 1, the fraction is already in lowest terms: numbers whose GCF is 1 are called relatively prime, or coprime (NIST Digital Library of Mathematical Functions, 27.1).
GCF, GCD, and HCF Are the Same Thing
Greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) all name the same number. U.S. middle school classes usually say GCF, while higher math and programming usually say GCD. "GCF" also comes up in algebra when you factor a common term out of a polynomial; that uses the same idea on variables as well as numbers (OpenStax, 7.1), which this calculator doesn't cover.
GCF vs. LCM
The GCF is the largest number that divides into all your numbers; the LCM is the smallest number they all divide into. For 12 and 18, the GCF is 6 and the LCM is 36, and for two numbers the GCF times the LCM equals their product (6 × 36 = 216 = 12 × 18). To find common multiples and common denominators, use the LCM calculator; to list every factor of a number with its factor pairs, the factor calculator. Students usually learn both in 6th grade (Common Core 6.NS.B.4). For practice, print our GCF and LCM worksheets with answer keys. See all math calculators.
| Compare | GCF | LCM |
|---|---|---|
| What it is | Largest number that divides all of them | Smallest number they all divide into |
| 12 and 18 | 6 | 36 |
| 24, 36, 60 | 12 | 360 |
| 9 and 28 | 1 | 252 |
| Prime factor rule | Lowest power of each shared prime | Highest power of every prime |
| Used for | Simplifying fractions | Common denominators |
Frequently Asked Questions
What does GCF mean in math?
GCF stands for greatest common factor: the largest whole number that divides evenly into each of the given numbers. The GCF of 8 and 12 is 4.
What if the GCF is 1?
Then the numbers have no common factor other than 1 and are called relatively prime. For example, 9 and 28 have a GCF of 1, even though neither is prime.
Can the GCF be one of the numbers?
Yes. If the smaller number divides the larger one, the smaller number is the GCF. The GCF of 6 and 18 is 6.
Why can't I use 0 or decimals?
The calculator works with positive whole numbers. Every number divides 0, so GCF(a, 0) is just a: a zero adds nothing, so leave it out. Decimals don't have whole-number factors. Negative numbers work: the calculator uses their positive values.
Sources
- OpenStax, Elementary Algebra 2e, 7.1 Greatest Common Factor and Factor by Grouping
- NIST Digital Library of Mathematical Functions, 27.1 Special Notation (Functions of Number Theory)
- Common Core State Standards for Mathematics, Grade 6, The Number System (6.NS.B.4)
- Formulas and test cases: math calculator methodology