GCF Calculator
Find the greatest common factor (also called the GCD, HCF or greatest common measure) of 2 to 10 whole numbers, with every step shown.
Separate numbers with commas or spaces, for example 48, 180 or 12, 18, 30.
12 is the largest number that divides 48 and 180 evenly.
Divide each number by the GCF
Dividing by the GCF gives the smallest whole numbers in the same ratio. This is how fractions and ratios are reduced.
Common factors: 1, 2, 3, 4, 6 and 12. Every common factor divides 12.
Your calculation
The same steps the calculator runs, with your numbers.
Euclid's algorithm
Divide, keep the remainder, and repeat until the remainder is 0.
| Step | Division | Remainder |
|---|
Prime factorization table
The GCF row takes the lowest power of each prime. A dash means the prime is missing, so it drops out of the GCF.
Factors of each number
Common factors are highlighted. The largest highlighted factor is the GCF.
| Number | Factors | Count |
|---|
Whole numbers from 1 to 10¹² are accepted. Numbers with more than 40 factors show the first 30 factors in the list.
What Is the Greatest Common Factor?
A factor (or divisor) of a whole number divides it with no remainder: the factors of 12 are 1, 2, 3, 4, 6 and 12. A common factor of two or more numbers appears in all of their factor lists. The greatest common factor (GCF) is the largest common factor.
For 12 and 18 the common factors are 1, 2, 3 and 6, so the GCF is 6. Every common factor divides the GCF, which is why the calculator lists the common factors as the factors of the GCF.
The same number goes by four names: greatest common factor (GCF), greatest common divisor (GCD), highest common factor (HCF) and greatest common measure (GCM). Euclid's Elements, Book VII, calls it the greatest common measure and describes the division method still used today. Number theory texts usually write GCD(a, b).
How to Use the GCF Calculator
- Enter the numbers. Type 2 to 10 whole numbers separated by commas or spaces, such as 48, 180. Each number can be as large as 1,000,000,000,000.
- Read the GCF. The large number is the greatest common factor. The chip beside it shows its prime factorization, or says "Coprime" when the GCF is 1.
- Use the details. The next card divides each number by the GCF, which gives the simplified fraction for two numbers or the reduced ratio for more. Below it you get the LCM, the steps with your numbers, Euclid's divisions, a prime factorization table and the full factor list of each number.
Results update as you type, and Enter recalculates. The quick examples cover two numbers, three numbers, a screen ratio and a pair with no common factor.
GCF Formula: Euclid's Algorithm
"a mod b" is the remainder when a is divided by b. Each step swaps the larger number for a smaller remainder, so the numbers shrink quickly. Euclid's original version subtracts the smaller number again and again, which leaves the same remainders.
GCF and LCM Formula
The product rule GCF × LCM = a × b holds for two numbers only. For three or more numbers, find the GCF two at a time.
How to Find the GCF Manually
Method 1: List the factors
Write every factor of each number and pick the largest one in all lists. For 12: 1, 2, 3, 4, 6, 12. For 18: 1, 2, 3, 6, 9, 18. The GCF is 6. This is quick for small numbers but slow for numbers with many factors.
Method 2: Prime factorization
Factor each number into primes, keep only the primes that appear in every number, take the lowest power of each, and multiply. For 48 and 180: 48 = 2⁴ × 3 and 180 = 2² × 3² × 5. The shared primes are 2 and 3, with lowest powers 2² and 3, so the GCF is 4 × 3 = 12. The 5 is dropped because 48 has no factor of 5.
Method 3: Euclid's division method
Divide the larger number by the smaller, then divide the previous divisor by the remainder, until a remainder is 0. For 884 and 3,009: 3,009 = 3 × 884 + 357, then 884 = 2 × 357 + 170, then 357 = 2 × 170 + 17, then 170 = 10 × 17 + 0. The GCF is 17. This method needs no factoring, so it works for very large numbers.
Method 4: The ladder (common division) method
Divide all the numbers by a prime that goes into every one of them, write the quotients below, and repeat until no prime divides them all. The GCF is the product of the primes on the left.
The LCM ladder also divides by primes that go into only some of the numbers. The GCF ladder stops as soon as no prime divides every number, here at 4 and 15.
Worked Example: GCF of 84, 126 and 210
Listing factors. The factors of 84 are 1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84. The factors of 126 are 1, 2, 3, 6, 7, 9, 14, 18, 21, 42, 63, 126. The factors of 210 are 1, 2, 3, 5, 6, 7, 10, 14, 15, 21, 30, 35, 42, 70, 105, 210. The factors in all three lists are 1, 2, 3, 6, 7, 14, 21 and 42, so the GCF is 42.
Prime factors. 84 = 2² × 3 × 7, 126 = 2 × 3² × 7 and 210 = 2 × 3 × 5 × 7. The primes in all three are 2, 3 and 7, each at power 1, so the GCF is 2 × 3 × 7 = 42.
Euclid, two at a time. 126 = 1 × 84 + 42 and 84 = 2 × 42 + 0, so GCF(84, 126) = 42. Then 210 = 5 × 42 + 0, so GCF(42, 210) = 42.
Check. 84 ÷ 42 = 2, 126 ÷ 42 = 3 and 210 ÷ 42 = 5. The quotients 2, 3 and 5 share no factor above 1, so no larger common factor exists. All three methods give 42.
GCF Table for Common Number Pairs
Each row shows the GCF, the fraction reduced by the GCF, and the LCM for comparison.
| Numbers | GCF | Simplest form | LCM |
|---|---|---|---|
| 8 and 12 | 4 | 2/3 | 24 |
| 12 and 18 | 6 | 2/3 | 36 |
| 15 and 25 | 5 | 3/5 | 75 |
| 18 and 24 | 6 | 3/4 | 72 |
| 24 and 36 | 12 | 2/3 | 72 |
| 36 and 54 | 18 | 2/3 | 108 |
| 36 and 60 | 12 | 3/5 | 180 |
| 42 and 56 | 14 | 3/4 | 168 |
| 48 and 80 | 16 | 3/5 | 240 |
| 48 and 180 | 12 | 4/15 | 720 |
| 1,920 and 1,080 | 120 | 16/9 | 17,280 |
| 17 and 31 | 1 | 17/31 | 527 |
GCF vs LCM
| GCF | LCM | |
|---|---|---|
| Meaning | Largest shared divisor | Smallest shared multiple |
| Prime powers | Lowest of shared primes | Highest of every prime |
| Size | At most the smallest number | At least the largest number |
| 12 and 18 | 6 | 36 |
| Used for | Simplifying, equal groups | Common denominators |
Understanding Your Result
The GCF is never larger than the smallest number. It equals the smallest number when that number divides all the others: the GCF of 12 and 48 is 12.
A GCF of 1 means the numbers are coprime. That does not require the numbers to be prime: 8 and 15 are both composite, yet their GCF is 1.
The quotients in the second card always have a GCF of 1. That is the check that no larger common factor was missed.
Where the GCF Is Used
Simplifying fractions
A fraction is in simplest form when its numerator and denominator share no factor other than 1. Dividing both by the GCF gets there in one step: the GCF of 24 and 36 is 12, so 24/36 = 2/3. For 48/180 the GCF is 12, giving 4/15.
Reducing ratios
A 1920 by 1080 pixel screen has a GCF of 120, so its aspect ratio is 1920 ÷ 120 : 1080 ÷ 120 = 16 : 9.
Splitting into equal groups
With 24 pencils and 36 erasers, the largest number of identical kits with nothing left over is GCF(24, 36) = 12. Each kit holds 2 pencils and 3 erasers.
Cutting the largest equal squares
A board 24 inches by 60 inches cut into the largest possible equal squares with no waste needs squares of GCF(24, 60) = 12 inches. That gives 2 × 5 = 10 squares.
Factoring algebra expressions
Factoring out the GCF reverses the distributive property. In 6x² + 9x, the GCF of the terms is 3x, so 6x² + 9x = 3x(2x + 3).
Common Mistakes
- Mixing up GCF and LCM. For 12 and 18, 6 is the GCF and 36 is the LCM. The GCF is the smaller of the two.
- Using the highest prime powers. Highest powers give the LCM. The GCF needs the lowest power of each shared prime.
- Keeping a prime that is not in every number. For 48 and 180, the 5 in 180 is dropped because 48 has no factor of 5.
- Reading the wrong number from Euclid's algorithm. The GCF is the last nonzero remainder, which is the divisor in the final division. It is not the last quotient.
- Assuming a GCF of 1 means the numbers are prime. 8 and 15 have a GCF of 1, but neither is prime.
- Entering 0 or negative numbers. GCF(a, 0) = a, so 0 adds nothing. The GCF of negative numbers is the GCF of their absolute values.
Related Calculations
The LCM Calculator finds the least common multiple, which pairs with the GCF through GCF × LCM = a × b. The Fraction Calculator uses the GCF to reduce answers to lowest terms, and the Ratio Calculator uses it to simplify ratios such as 1920 : 1080 to 16 : 9.
Prime factorization also drives the Root Calculator, which simplifies radicals such as √72 = 6√2, and the Exponent Calculator handles the prime powers that appear in a factorization.
Frequently Asked Questions
How do you find the GCF of two numbers?
The fastest method is 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 divisor in that last division is the GCF. For 48 and 180: 180 = 3 × 48 + 36, 48 = 1 × 36 + 12 and 36 = 3 × 12 + 0, so the GCF is 12. For small numbers you can also list the factors of each number and pick the largest shared one. The factors of 12 are 1, 2, 3, 4, 6 and 12, and the factors of 18 are 1, 2, 3, 6, 9 and 18, so the GCF of 12 and 18 is 6.
What is the GCF of 12 and 18?
The GCF of 12 and 18 is 6. The factors of 12 are 1, 2, 3, 4, 6 and 12, and the factors of 18 are 1, 2, 3, 6, 9 and 18. The common factors are 1, 2, 3 and 6, and the largest is 6. With prime factors, 12 = 2² × 3 and 18 = 2 × 3², and the lowest power of each shared prime gives 2 × 3 = 6. Dividing both numbers by the GCF reduces the fraction 12/18 to 2/3. The LCM of 12 and 18 is 36, and 6 × 36 = 216 = 12 × 18.
What is the difference between GCF, GCD, HCF and GCM?
There is no difference in the answer. Greatest common factor (GCF), greatest common divisor (GCD), highest common factor (HCF) and greatest common measure (GCM) are four names for the same number: the largest whole number that divides every given number with no remainder. The names differ only by convention. Euclid's Elements, Book VII, calls it the greatest common measure, and number theory texts usually write GCD(a, b). Algebra textbooks such as OpenStax Elementary Algebra use GCF. For 48 and 180, all four names give the same result, 12.
How do you find the GCF of three numbers?
Find the GCF of the first two numbers, then find the GCF of that result and the third number. For 84, 126 and 210: GCF(84, 126) = 42, and GCF(42, 210) = 42, so the GCF is 42. With prime factors, 84 = 2² × 3 × 7, 126 = 2 × 3² × 7 and 210 = 2 × 3 × 5 × 7. The primes shared by all three are 2, 3 and 7, each at its lowest power, so the GCF is 2 × 3 × 7 = 42. A prime that is missing from even one number, such as 5 here, is left out.
What does it mean if the GCF is 1?
A GCF of 1 means the numbers share no factor other than 1, so they are called relatively prime or coprime. For example, 17 and 31 have a GCF of 1, and so do 8 and 15 even though neither 8 nor 15 is prime. A fraction whose numerator and denominator have a GCF of 1, such as 8/15, is already in simplest form. Any two consecutive whole numbers, such as 20 and 21, are coprime, because a number that divides both would also divide their difference of 1. When the GCF of two numbers is 1, their LCM equals their product.
Sources & References
- Euclid, Elements, Book VII, Proposition 2: "To find the greatest common measure of two given numbers", with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
- NIST Dictionary of Algorithms and Data Structures. Euclid's algorithm. xlinux.nist.gov
- OpenStax. Elementary Algebra 2e, 7.1 Greatest Common Factor and Factor by Grouping (GCF by prime factors, factoring out the GCF). openstax.org
- OpenStax. Prealgebra 2e, 4.2 Multiply and Divide Fractions (simplified form of a fraction). openstax.org
Results are for educational purposes. Every worked number on this page was recomputed with the same functions the calculator uses. Methodology reviewed: 2026.