GC
GCF Calculator (Greatest Common Factor)
Find the greatest common factor of two or more whole numbers using the fast Euclidean algorithm.
More Math Tools
How to Use GCF Calculator (Greatest Common Factor)
Enter a comma-separated list of two or more positive whole numbers. The calculator reduces the list pairwise using the Euclidean algorithm and shows the greatest common factor (GCF), also known as the greatest common divisor (GCD), live as you type.
About GCF Calculator (Greatest Common Factor)
The greatest common factor (GCF), also called the greatest common divisor (GCD), of a set of whole numbers is the largest whole number that divides evenly into every number in the set, with no remainder left over. It is one of the most fundamental ideas in number theory and shows up constantly in practical situations, from simplifying fractions to splitting items evenly into groups.
The most direct way to find a GCF by hand is to list every factor of each number and pick the largest one they share. Take 12 and 18. The factors of 12 are 1, 2, 3, 4, 6, 12. The factors of 18 are 1, 2, 3, 6, 9, 18. The factors they share are 1, 2, 3, and 6, and the greatest of those shared factors is 6. So the GCF of 12 and 18 is 6. This listing method works fine for small numbers but becomes slow and error-prone for larger ones — imagine trying to list every factor of 8,904 and 1,491 by hand.
That is where the Euclidean algorithm comes in, a far faster method discovered over two thousand years ago and still the standard approach used by calculators and computers today. It relies on a simple but powerful fact: the GCF of two numbers does not change if you replace the larger number with the remainder of dividing it by the smaller number. You repeat this process — divide, take the remainder, replace the larger number with that remainder — until the remainder becomes 0. At that point, the other number left over is the GCF.
Let's walk through 8,904 and 1,491 to see how quickly this converges. Divide 8,904 by 1,491: it goes 5 times with a remainder of 8,904 − (5 × 1,491) = 8,904 − 7,455 = 449. Now find the GCF of 1,491 and 449 instead. Divide 1,491 by 449: it goes 3 times with a remainder of 1,491 − 1,347 = 144. Now find the GCF of 449 and 144. Divide 449 by 144: it goes 3 times with a remainder of 449 − 432 = 17. Now find the GCF of 144 and 17. Divide 144 by 17: it goes 8 times with a remainder of 144 − 136 = 8. Now find the GCF of 17 and 8. Divide 17 by 8: it goes 2 times with a remainder of 1. Now find the GCF of 8 and 1. Divide 8 by 1: it goes 8 times exactly, remainder 0. Once the remainder hits 0, the GCF is the last non-zero remainder we were dividing by, which is 1. So 8,904 and 1,491 share no common factor larger than 1 — they are what's called coprime, even though neither is a small number.
When you have more than two numbers, the GCF of the whole group is found by applying the Euclidean algorithm pairwise: find the GCF of the first two numbers, then find the GCF of that result and the third number, and so on until every number in the list has been folded in. The order does not matter — GCF is associative, so you get the same final answer regardless of which pair you start with.
A common misconception is confusing GCF with LCM (Least Common Multiple), its close relative. GCF is the largest number that divides into all your numbers; LCM is the smallest number that all your numbers divide into. They solve opposite kinds of problems: GCF is for splitting things into equal groups or simplifying ratios, while LCM is for finding when repeating events line up, like syncing schedules. This site's companion LCM Calculator uses the very same Euclidean algorithm under the hood — GCF and LCM are mathematically linked by the identity LCM(a,b) × GCF(a,b) = a × b.
Details & Tips
**Formula (Euclidean algorithm):** To find gcd(a, b): while b is not 0, replace (a, b) with (b, a mod b). When b reaches 0, a is the GCF. For a list of more than two numbers, reduce pairwise: gcd(gcd(gcd(n1, n2), n3), n4), and so on.
**Worked example 1:** Find the GCF of 48 and 18. 48 mod 18 = 12 (since 18 × 2 = 36, remainder 12). Now find gcd(18, 12): 18 mod 12 = 6. Now find gcd(12, 6): 12 mod 6 = 0. The last non-zero remainder was 6, so GCF(48, 18) = 6.
**Worked example 2 (three numbers):** Find the GCF of 24, 36, and 60. First, gcd(24, 36): 36 mod 24 = 12, then gcd(24, 12) = 0 remainder when 24 mod 12, so gcd(24, 36) = 12. Next, fold in 60: gcd(12, 60). Since 60 mod 12 = 0 immediately, gcd(12, 60) = 12. So GCF(24, 36, 60) = 12.
**How this calculator parses input:** Numbers are entered as a comma-separated list (spaces are also accepted as separators). Each token is checked to be a positive whole number; anything else — decimals, negative numbers, zero, or non-numeric text — is silently excluded from the calculation, and a hint below the result explains that only positive whole numbers are used.
**Edge cases handled:**
- Fewer than 2 valid whole numbers entered → no result is shown, since a GCF requires at least two numbers to compare.
- Non-integer entries (like 4.5) are ignored rather than rounded, avoiding a misleading result based on a number you did not actually intend to enter.
- Zero and negative numbers are excluded, since GCF is conventionally defined only for positive integers.
- Identical numbers in the list (e.g. 12 and 12) correctly return that same number as the GCF, since a number is always a factor of itself.
- Coprime numbers (numbers sharing no common factor besides 1, like 8 and 15) correctly return a GCF of 1.
**Practical tip:** GCF is the key to simplifying fractions to lowest terms — divide both the numerator and denominator by their GCF. For 36/48, the GCF is 12, so the fraction simplifies to 3/4. It is also the tool of choice for "equal groups" problems: if you have 24 apples and 36 oranges and want to make identical gift baskets using all the fruit with nothing left over, the GCF (12) tells you the maximum number of baskets you can make, with each getting 2 apples and 3 oranges. For the reverse kind of problem — figuring out when repeating cycles line back up — use the companion LCM Calculator instead.
Frequently Asked Questions
What is the greatest common factor (GCF)?
It is the largest whole number that divides evenly into every number in a given list, with no remainder.
Is GCF the same as GCD?
Yes, Greatest Common Factor (GCF) and Greatest Common Divisor (GCD) refer to exactly the same thing and are used interchangeably.
How does the Euclidean algorithm find the GCF?
It repeatedly replaces the larger number with the remainder of dividing it by the smaller number, until the remainder reaches zero — the last non-zero remainder is the GCF.
Can I find the GCF of more than two numbers?
Yes, this calculator reduces the whole list pairwise: it finds the GCF of the first two numbers, then combines that result with the next number, and so on.
What is the GCF of two numbers that share no common factor?
It is 1. Numbers like this are called coprime, meaning their only common divisor is 1.
Does the calculator accept decimal or negative numbers?
No, GCF is only defined for positive whole numbers, so decimals, zero, and negative entries are ignored automatically.
What is the GCF used for in real life?
Simplifying fractions to their lowest terms, and splitting different quantities of items into the largest possible number of identical equal groups.
What is the GCF of a number and itself?
It is that number itself, since every number is a factor of itself.
Is the GCF ever larger than the smallest number in the list?
No, the GCF can never be larger than the smallest number in the list, since it must divide evenly into every number including the smallest one.
How is GCF different from LCM?
GCF is the largest number that divides into all your numbers; LCM is the smallest number that all your numbers divide into — they solve opposite problems.
Does this tool send my numbers to a server?
No, all calculation happens locally in your browser using plain JavaScript arithmetic.
Also Available As
GCF calculator, GCD calculator, greatest common divisor, greatest common factor finder, euclidean algorithm calculator, HCF calculator
Explore More Tools
View all toolsFound a Problem?
Let us know if something with GCF Calculator (Greatest Common Factor) isn't working as expected.
Something went wrong. Please try again.
Thanks — we'll take a look.