Enter two or more whole numbers to get their greatest common factor (GCD) instantly, with the LCM of the same numbers shown too.
Greatest Common Factor Calculator
Find the greatest common factor of any list of whole numbers in one step — and see the LCM of the same numbers alongside it.
Enter your values
Fill in the fields below — the result appears with every step shown.
Your result will appear here
Enter your values above, then press Calculate — or press Enter in any field.TinyExe · Greatest Common Factor Result
Calculated locally in your browser
—
Name
—
Numbers (comma or space separated)
—
Input 2
—
Result
—
How this was calculated
What to do next
TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.
Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.
The short answer
The greatest common factor of a set of whole numbers is the largest positive integer that divides every one of them exactly. It is found fastest with the Euclidean algorithm, repeatedly replacing a number by the remainder of division. For example, the GCF of 48 and 180 is 12, and of 100, 75 and 50 is 25.
- GCF and GCD (greatest common divisor) are the same value
- If the GCF is 1 the numbers are coprime (relatively prime)
- For two numbers, GCF x LCM = the product of the two numbers
GCF facts worth knowing
Reference values for this calculator.
| Situation | GCF | Meaning |
|---|---|---|
| Coprime numbers (e.g. 8 and 15) | 1 | They share no factor except 1 |
| One number divides the other (6 and 18) | 6 | The smaller number is the GCF |
| Identical numbers (24 and 24) | 24 | A number is its own GCF |
| Even numbers | At least 2 | 2 always divides both |
The formula
The exact formula this calculator uses — every variable in it is explained in the card below.
The formula
Ideas enhancement: as well as the GCF itself, the tool reports the LCM of the same list, because the pair GCF x LCM = a x b for two numbers is the relationship students are usually asked to use next.
Worked examples
Worked examples with the full working shown — try them in the calculator to check.
Example 1
Two numbers
48 and 180
| Calculation | Steps |
|---|---|
| gcd(180, 48): 180 = 48 x 3 + 36; 48 = 36 x 1 + 12; 36 = 12 x 3 + 0, so the GCF is 12. | GCF of 48 and 180 is 12. |
Result
Example 2
Coprime pair
7 and 13
| Calculation | Steps |
|---|---|
| 13 = 7 x 1 + 6; 7 = 6 x 1 + 1; 6 = 1 x 6 + 0, so the GCF is 1 — the numbers are coprime. | GCF of 7 and 13 is 1. |
Result
Example 3
Three numbers
100, 75 and 50
| Calculation | Steps |
|---|---|
| gcd(100, 75) = 25; then gcd(25, 50) = 25, so the whole list shares 25. | GCF of 100, 75 and 50 is 25. |
Result
How to use this calculator
Step 1
Type two or more positive whole numbers, separated by commas or spaces.
Step 2
Press Calculate to run the Euclidean algorithm across the whole list.
Step 3
Read the GCF as the headline result.
Step 4
Check the details card for the LCM of the same numbers if your problem needs it.
Step 5
Use the GCF to simplify a fraction by dividing top and bottom by it.
Frequently asked questions
What is the greatest common factor?
It is the largest positive whole number that divides each of your numbers exactly, with no remainder. The GCF of 48 and 180 is 12 because 12 divides both and nothing larger does.
Is GCF the same as GCD?
Yes. Greatest common factor and greatest common divisor are two names for the same value; maths textbooks use GCD, school arithmetic usually says GCF or HCF (highest common factor).
How does the Euclidean algorithm find the GCF?
Replace the larger number by the remainder when it is divided by the smaller, and repeat. When the remainder reaches 0, the last divisor is the GCF. It is far faster than listing all factors for big numbers.
What is the GCF of two prime numbers?
Always 1, because a prime has no factors besides 1 and itself, so two different primes share only 1. Numbers with GCF 1 are called coprime or relatively prime.
How is the GCF used with fractions?
To simplify a fraction, divide numerator and denominator by their GCF: 48/180 divided top and bottom by 12 becomes 4/15, the fraction in lowest terms.
About this calculator
A greatest common factor calculator finds the largest whole number that divides each of your numbers exactly. Enter a list — two numbers or twenty — and it reduces the list pairwise with the Euclidean algorithm to a single GCF, and also reports the least common multiple of the same numbers.
Every whole number has factors — the numbers that divide it exactly. 48 has factors 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48; 180 has 1, 2, 3, 4, 5, 6, 9, 10, 12 and more. The factors they share are 1, 2, 3, 4, 6 and 12, and the greatest of those shared factors is 12. Listing factors works for small numbers but collapses for large ones, which is why the calculator uses Euclid's method instead.
The Euclidean algorithm rests on one observation: any common divisor of a and b also divides their remainder when a is divided by b. So gcd(180, 48) = gcd(48, 36) = gcd(36, 12) = gcd(12, 0) = 12. Each step shrinks the numbers quickly, so even a GCF of two ten-digit numbers takes only dozens of steps. For three or more numbers, the GCF of the whole list is the GCF of the first two, then the GCF of that result with the third, and so on.
The most common mistake is confusing GCF with LCM: the GCF is never larger than the smallest number in the list, while the LCM is never smaller than the largest. If your answer is bigger than your smallest input, you have found an LCM, not a GCF.
Use it to simplify fractions to lowest terms, to split quantities into the largest equal groups with nothing left over, to find common denominators (with the LCM shown alongside), and for school number-theory work on factors, multiples and coprime pairs.
How to calculate it yourself
Step 1
List the factors of each number, or start the Euclidean algorithm with the two largest numbers.
Step 2
Divide the larger by the smaller and keep the remainder.
Step 3
Replace the larger number with the smaller, and the smaller with the remainder; repeat.
Step 4
When the remainder is 0, the current divisor is the GCF of the pair.
Step 5
For a longer list, repeat using that GCF and the next number until the list is finished.
Real-life examples
Simplifying a recipe ratio
A cook's master sauce uses 48 g of spice blend to 180 g of oil and the ratio must be written in lowest terms for a label.
GCF of 48 and 180 is 12. Dividing both by 12 gives 4 g of spice to 15 g of oil.
The label ratio is 4 : 15, exactly equivalent to 48 : 180.
Equal gift bags with nothing left over
A teacher has 100 pencils, 75 pens and 50 notebooks and wants identical supply bags using everything.
GCF of 100, 75 and 50 is 25, so she can make 25 bags with 4 pencils, 3 pens and 2 notebooks each.
25 identical bags, nothing left over.
Ideas & use cases
- Simplify any fraction instantly: the GCF of numerator and denominator is the single number to divide both by to reach lowest terms.
- Check for coprime pairs before using the formula GCF x LCM = a x b — if the GCF is 1, the LCM is simply the product.
- Party-planning split: enter the counts of several items to find the largest number of identical packs, tables or teams you can make with no leftovers.
Limitations & sources
- Positive whole numbers only. It does not handle decimals, fractions, negative numbers or algebraic expressions, and very long lists are reduced pairwise, which is exact but shows only the final GCF.
Sources: Euclidean algorithm: Euclid's Elements, Book VII; standard number-theory references (e.g. Khan Academy GCF lessons)
