Try it with your numbers
Show every step
For example, . This page shows three ways to find it (listing, prime factorization and Euclid’s algorithm), when each one wins, and how the GCF carries over into fractions, algebra and everyday problems.
What is the greatest common factor (GCF, GCD, HCF)?
A factor of a number divides it exactly. The factors of are , and the factors of are . The numbers they share are , and the greatest of those is . In symbols, . The same quantity is called the greatest common divisor (GCD) or highest common factor (HCF), and the notation (see what a|b means in math) is just shorthand for ” divides evenly.”
One clean idea sits underneath everything else on this page: the common factors of two numbers are exactly the factors of their GCF. The common factors of and are , and those are precisely the factors of , which is their GCF. So the GCF is not just the biggest shared factor. It is the one number that contains all the others, and that is why every method below works.
The word “factor” here always means a whole-number divisor. If you need a full reference list, the factors of numbers 1 to 100 page has every factor pair ready to compare.
How do you find the greatest common factor by listing?
Write out the factors of each number, circle the ones that appear on every list, and pick the largest. For and :
The shared factors are , so . Divisibility rules make the lists fast to build: the digit-sum test for and and the last-two-digits test for remove most of the guessing.
A shortcut saves most of the list. Any common factor of two numbers also divides their difference, because if goes into both and , it goes into . Here the difference is , so the GCF can be at most and must be a factor of . Test the biggest candidate first: and , so works and the search is over. When two numbers are close together, this finishes in one step.
Listing breaks down once the numbers get large. The factor list of is long and error-prone, and one missed factor gives a wrong answer with no warning. For anything past two digits, switch to one of the next two methods.
Quick check
Answer:
Finding the GCF with prime factorization
Every whole number greater than has exactly one prime factorization, and a number divides another only if its primes fit inside the other’s primes. That gives the rule: for each prime that appears in all the numbers, keep the smallest exponent, then multiply.
Take and . Splitting each into primes (the prime numbers from 1 to 100 list helps with the small ones):
The primes shared by both are and . The smaller exponent on is , and the smaller exponent on is also . The primes and appear in only one number, so they drop out.
Check: and , and and share no factor, so nothing larger could have fit.
Take the smaller exponent, not the larger. Here has and has , so only fits into both. Using the larger exponents builds the LCM instead.
The same rule handles three or more numbers: a prime must appear in every number to count, and you still take the smallest exponent. For , and , the shared primes are , and , each at exponent , giving .
How does the Euclidean algorithm find the GCD?

Factoring a large number can be slow, but Euclid’s method never factors anything. It rests on one fact: if divides both and , then also divides for any whole number . Dividing by leaves a remainder , so the pair and the pair have exactly the same common divisors.
Repeat until the remainder is . The last nonzero remainder is the GCF. For :
The last nonzero remainder is , so . Check: and , and and are coprime. Each step is just integer division with a remainder, so the method needs no tables and no guessing. It is also fast: the remainders at least halve every two steps, which is why it is still used inside the software that generates encryption keys.
Try this: Run Euclid’s algorithm on and . Then divide both numbers by your answer and confirm the two results share no factor.
How are the GCF and LCM related?

For two numbers, the GCF and the least common multiple multiply to give the product of the numbers:
The reason is in the exponents. For each prime, the GCF takes the smaller exponent and the LCM takes the larger, and . For and , the LCM is , and . This gives a quick way to get the LCM once the GCF is known: .
This identity holds only for pairs. For three numbers, multiplying GCF and LCM does not return the product of all three, so find the GCF and LCM separately.
| GCF | LCM | |
|---|---|---|
| Prime exponents | smallest shared | largest overall |
| Size | at most the smallest number | at least the largest number |
| Typical job | reducing fractions | adding fractions with unlike denominators |
Quick check
Answer:
GCF with zero, negatives, primes and coprime numbers
A few edge cases come up in tests, and they all follow from the definition:
- , because every integer divides , so the biggest divisor of is itself. The pair has no greatest common factor and is usually left undefined.
- Signs are ignored: . Factors come in positive and negative pairs, and the GCF is the largest positive one, so it behaves like working with the absolute value of each number.
- If one number divides the other, the smaller is the GCF: .
- for every .
Two numbers with GCF are called coprime (or relatively prime). Consecutive integers are always coprime, since a common factor would have to divide their difference, which is . That is why for every .
and are both composite, yet . Coprime describes a pair of numbers, while prime describes a single number.
Mixed-sign pairs are no harder than positive ones, but sign slips can sneak in when the numbers come from arithmetic first. If you compute a difference such as before taking a GCF, the rules for subtracting integers apply before the factoring starts.
How do you factor out the GCF of an expression?
In algebra, the GCF of an expression is the largest term that divides every term. Find it in two parts: the GCF of the numerical coefficients, then each variable at its smallest exponent among the terms. A variable missing from even one term stays out.
Factor .
- Coefficients: .
- Powers of are , so the smallest is .
- Powers of are , so the smallest is .
The GCF is . Divide each term by it:
Multiply back to check: , , and . This is the distributive property run in reverse.
The trap here is a vanishing term. If a term equals the GCF, it leaves a behind, not nothing: , and dropping the gives wrongly written as or lost entirely in the middle step. When the leading term is negative, factor out the negative too, so . Pulling out the GCF is nearly always the first move in factoring, before any other technique.
Where is the greatest common factor used in real life?
The most common use is simplifying fractions. To reduce , divide top and bottom by and get in one step, with no repeated halving. This is the one-step version of simplifying fractions. The same move shrinks a ratio: becomes after dividing by .
The GCF also answers “largest equal piece” questions. Two boards of cm and cm can be cut into equal pieces with no waste, and the longest possible piece is cm, giving pieces from the first board and from the second. Any problem phrased as “largest square tile,” “most identical groups” or “longest equal length” is a GCF problem, while “first time they line up again” is an LCM problem.
Beyond the classroom, Euclid’s algorithm runs inside the code that creates public-key encryption keys, where it tests whether two huge numbers are coprime. The calculation is the same one you did with and , only on numbers with hundreds of digits.
Quick check
Answer: cm tiles, of them
How can you check a GCF answer?
Three quick tests catch almost every error:
- Divide each original number by your answer. Every result must be a whole number.
- Look at those quotients. They must be coprime. If they still share a factor, your GCF is too small.
- Compare size. The GCF cannot exceed the smallest number, and it must divide any difference between the numbers.
Test 2 is the powerful one. Suppose someone claims . The quotients are and , and those share a factor of , so the true answer is . Confirm: and , and and are coprime.
The method itself also depends on getting the arithmetic right, so when a result looks off, recheck the factorization before blaming the idea. Careful work with multiplying integers and the correct order of operations when you multiply the shared primes back together prevents most slips.
Practice problems
0 of 5 solved
- Find the greatest common factor of and .
Answer:
Factors of : . Factors of : . The common factors are , and the largest is . - Find .
Answer:
Write and . Take the smaller exponent of each shared prime: and . Multiply: . - Find the GCF of , and .
Answer:
Factor: , , . The smallest exponents of the shared primes are and . So the GCF is . Check: , , . - Use the Euclidean algorithm to find .
Answer:
, then , then , then . Finally , so the last nonzero remainder, , is the GCF. Check: and . - Factor out the GCF: .
Answer:
The coefficients have GCF . The smallest power of is and the smallest power of is , so the GCF is . Divide each term by it to get , and . Multiplying back gives the original expression.
Common questions
What is the greatest common factor in simple terms?
It is the largest whole number that divides two or more numbers with no remainder. For and it is , because goes into both and nothing bigger does.
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number. US classrooms usually say GCF, college courses and calculators often say GCD, and HCF is common in the UK and India.
What is the GCF of two prime numbers?
It is , as long as the primes are different. Each prime has only and itself as factors, so the only factor they share is . If the two primes are the same, such as and , the GCF is that prime.
How do you find the GCF of three or more numbers?
Find the GCF of the first two, then find the GCF of that result and the third number, and continue. In symbols, . With prime factorizations, take the smallest exponent of each prime that appears in every number.
What is the GCF of a number and zero?
It is the number itself (ignoring sign), because every integer divides . So . The case has no largest common factor, and most textbooks either call it undefined or set it to by convention.
What is the difference between the GCF and the LCM?
The GCF is the largest number that divides all the given numbers, so it is never bigger than the smallest of them. The LCM is the smallest number that all of them divide into, so it is never smaller than the largest of them.