CALCULATORCASTLE

Common Factor Calculator

Find all common factors shared between two or more numbers.

About

Common Factor Calculator

Paste a list of whole numbers and the calculator returns every factor they share, along with the greatest of them. The working shows the factors of each number separately, then the ones that appear in all of the lists, and it repeats the same answer through prime factorisation so you can see both methods on your own numbers.

What a factor is

A factor is a number that divides into another leaving nothing over. It is one of the terms in a multiplication, so in 3 × 4 = 12 both 3 and 4 are factors of 12.

Most numbers have several. Twelve can be built four ways: 1 × 12, 2 × 6, 3 × 4, and the same pairs reversed. Collecting the terms gives the full list of factors of 12: 1, 2, 3, 4, 6, 12. Every whole number above 1 has at least two, since 1 and the number itself always divide it, and a number whose only factors are those two is prime.

Factors always come in pairs that multiply to the original, which is the practical shortcut for finding them: test only up to the square root, and each divisor found hands you its partner. For 12 you need to test as far as 3, since 4 × 3 has already appeared as 3 × 4. That is also why a perfect square has an odd number of factors, because the square root pairs with itself.

What a common factor is

A common factor, also called a common divisor, is a number that divides every value in your set. Take 16 and 12:

The factors of 16 are 1, 2, 4, 8, 16.
The factors of 12 are 1, 2, 3, 4, 6, 12.
So the common factors of 16 and 12 are 1, 2 and 4.

The largest of them, 4 here, is the greatest common factor. You will also see it written as the greatest common divisor or highest common factor, and abbreviated GCF, GCD or HCF. All four names mean the same number.

Every set of whole numbers has at least one common factor, because 1 divides everything. When 1 is the only one they share, the numbers are called coprime or relatively prime. That does not mean either number is prime: 8 and 9 are coprime and neither is a prime number.

The one fact that saves the most work

The common factors of any set are exactly the factors of their greatest common factor. Nothing else, and nothing missing.

On the numbers loaded above the greatest common factor is 15, and the common factors are 1, 3, 5 and 15, which is precisely the list of factors of 15. It has to work out that way: anything dividing all the numbers must divide their greatest common factor, and anything dividing that must divide each of them.

So the shortest route to the full list is to find the greatest common factor first and then list its factors, rather than factoring every number and comparing. That is what the calculator does internally, and it is why a list of very large numbers still returns instantly.

Three ways to find the greatest common factor

Listing is the method the steps above show. Write out the factors of each number, then pick out the ones appearing in every list. It is transparent and fine for small numbers, and it becomes hard work quickly.

Prime factorisation scales better. Break each number into primes, then take every prime that appears in all of them, each at the lowest power it appears to. On the loaded numbers: 330 = 2 × 3 × 5 × 11, 75 = 3 × 5², 450 = 2 × 3² × 5², and 225 = 3² × 5². Only 3 and 5 appear in all four, and the lowest power of each is the first, so the greatest common factor is 3 × 5 = 15. The 2 is missing from 75 and 225, and the 11 appears only in 330, so neither can contribute.

Euclid's algorithm is the fastest and needs no factoring at all. Divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and that remainder until the remainder is zero. The last non-zero value is the answer:

gcd(a,b)=gcd(b,a mod b)

For 330 and 75: 330 divided by 75 leaves 30, then 75 divided by 30 leaves 15, then 30 divided by 15 leaves 0, so the answer is 15. For more than two numbers, work through them in pairs, since the greatest common factor of a whole set can be built up two at a time.

The method comes from Euclid's Elements, Book VII, written around 300 BC, which makes it one of the oldest algorithms still in everyday use. It is quick because the numbers collapse fast: the worst case, proved by Gabriel Lamé in 1844, is a pair of consecutive Fibonacci numbers, and even then the number of steps grows only with the number of digits.

The link to the lowest common multiple

For any two numbers, the greatest common factor and the lowest common multiple are tied together:

GCF(a,b)×LCM(a,b)=a×b

So knowing one gives the other. For 16 and 12 the product is 192 and the greatest common factor is 4, so the lowest common multiple is 48. Note the relationship holds for two numbers only, and does not extend to three or more.

Where common factors get used

Simplifying fractions is the everyday one. To reduce a fraction to lowest terms, divide the top and bottom by their greatest common factor: 8/12 both divide by 4, giving 2/3. Divide by a smaller common factor and the fraction gets simpler but is not finished, which is why the greatest one is the one you want.

Splitting things into equal groups. With 330 red beads, 75 blue and 450 green, the greatest number of identical bundles you can make with none left over is 15, and each bundle holds 22 red, 5 blue and 30 green.

Fitting a grid. The largest square tile that fills a 330 by 75 area exactly is 15 units on a side, because the tile edge has to divide both dimensions.

Ratios and gears. Reducing 450:225 to 2:1 is the same operation, and in mechanical design the greatest common factor of two gear tooth counts tells you how often the same pair of teeth meet, which matters for wear.

Beyond arithmetic, coprimality underpins modern cryptography: RSA depends on choosing an exponent coprime to a particular value, and Euclid's algorithm extended slightly is what finds the key.

Reading your result

Check the count first. If the calculator reports 1 as the only common factor, your numbers are coprime and there is nothing to cancel between them.

The greatest common factor is never larger than your smallest number, and when the smallest number divides all the others it is the answer. On 75, 225 and 450 that is exactly what happens, since 75 divides both of the others.

The calculator takes positive whole numbers only. Factors of negative numbers are the same as those of their absolute value with signs attached, and decimals have no factors in this sense at all. For a single number's factors use the Factor Calculator, for the prime breakdown use the Prime Factorization Calculator, and to reduce a fraction with the answer use the Fraction Calculator.

Common questions

Frequently asked questions

A number that divides every value in your set leaving no remainder. The factors of 16 are 1, 2, 4, 8 and 16, and those of 12 are 1, 2, 3, 4, 6 and 12, so their common factors are 1, 2 and 4. The largest of them, 4, is the greatest common factor.

Nothing. Greatest common factor, greatest common divisor and highest common factor are three names for the same number, and which you meet depends mostly on where you were taught. The calculator reports it as the GCF.

Use Euclid's algorithm: divide the larger by the smaller, keep the remainder, and repeat until the remainder is zero. For 330 and 75 that runs 330 into 75 leaving 30, then 75 into 30 leaving 15, then 30 into 15 leaving 0, so the answer is 15. No factoring needed.

Because anything dividing all your numbers must divide their greatest common factor, and anything dividing that must divide each of them. The two sets are therefore identical, which is why finding the GCF first and listing its factors is the shortest route to the full list.

The numbers are coprime, also called relatively prime, and there is nothing to cancel between them. It does not mean they are prime themselves: 8 and 9 are coprime and neither one is a prime number.

Divide the numerator and denominator by their greatest common factor. For 8/12 that factor is 4, giving 2/3. Using a smaller common factor still simplifies the fraction but leaves it unfinished, which is why the greatest one is the one to use.

This calculator takes positive whole numbers. Factors of a negative number are the same as those of its absolute value with signs attached, so the common factors are unchanged. Decimals have no factors in this sense, since factors are defined for whole numbers.

For two numbers, the greatest common factor multiplied by the lowest common multiple equals the product of the numbers. With 16 and 12 the product is 192 and the GCF is 4, so the LCM is 48. The relationship holds for pairs only, not for three or more numbers.