How to use the GCF calculator
- Enter two or more whole numbers, separated by commas or spaces. Very large numbers work too.
- Read the GCF and whether the numbers are coprime.
- Check the working: every common factor, each number's prime factorization, and the Euclidean algorithm steps.
Three ways to find the GCF
1. List the factors
Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18. The largest one in both lists is 6. This is simple for small numbers but slow for big ones.
2. Prime factorization
Common primes, lowest powers: 2ยฒ ร 3 = 12
3. Euclidean algorithm
1071 = 2 ร 462 + 147 ยท 462 = 3 ร 147 + 21 ยท 147 = 7 ร 21 + 0 โ GCF = 21
The Euclidean algorithm is the fastest method by far, which is why the calculator can handle numbers dozens of digits long.
Examples
| Numbers | GCF | Note |
|---|---|---|
| 12, 18 | 6 | 12/18 simplifies to 2/3 |
| 48, 180, 300 | 12 | Common factors 1, 2, 3, 4, 6, 12 |
| 1071, 462 | 21 | Classic Euclid example |
| 17, 31 | 1 | Both prime, so coprime |
| 8, 15 | 1 | Coprime, though neither is prime |
Using the GCF
- Simplify fractions: divide the top and bottom by their GCF, so 48/180 = 4/15. The fraction calculator does this automatically.
- Reduce ratios: 48:180 simplifies to 4:15. See the ratio calculator.
- Simplify roots: pulling perfect squares out of โ72 uses the same factoring idea. Try the square root calculator.
- Equal groups: 48 red and 180 blue beads make at most 12 identical bags (4 red + 15 blue each).
More math calculators.
Sources
Frequently asked questions
What is the greatest common factor?
The greatest common factor (GCF) of two or more whole numbers is the largest number that divides all of them with no remainder. It's also called the greatest common divisor (GCD) or highest common factor (HCF). The GCF of 12 and 18 is 6.
How do I find the GCF?
Three common methods: list the factors of each number and pick the largest one they share; write each number as a product of primes and multiply the primes they have in common (using the lowest power); or use the Euclidean algorithm, repeatedly dividing and keeping the remainder until it reaches 0.
How does the Euclidean algorithm work?
Divide the larger number by the smaller and keep the remainder, then divide the smaller number by that remainder, and repeat. The last non-zero remainder is the GCF. For 1071 and 462: 1071 = 2 ร 462 + 147, 462 = 3 ร 147 + 21, 147 = 7 ร 21 + 0, so the GCF is 21.
How do I find the GCF of three or more numbers?
Find the GCF of the first two, then the GCF of that result and the next number, and so on: GCF(48, 180, 300) = GCF(GCF(48, 180), 300) = GCF(12, 300) = 12.
What does it mean if the GCF is 1?
The numbers are relatively prime (coprime): they share no factor except 1, though each may not be prime itself. For example, 8 and 15 are coprime. A fraction with a coprime top and bottom is already in lowest terms.
What is the GCF used for?
Simplifying fractions (divide top and bottom by their GCF), reducing ratios, factoring expressions like 6x + 9 = 3(2x + 3), and splitting things into the largest equal groups, such as cutting 48 cm and 180 cm boards into the longest equal pieces with no waste (12 cm).