Greatest Common Factor Calculator (GCF, HCF, GCD) with Factor Lists, Prime Factors and Euclidean Algorithm Steps

Find the biggest whole number that divides every number in your list, and see it worked out three ways: listing the factors, comparing prime factors and the Euclidean algorithm.

Enter whole numbers

Enter 2 to 50 whole numbers, each up to 100 digits. Leave out thousands separators, so type 1200 rather than 1,200. The page address updates as you go, so you can share a result.

Try:

What is the greatest common factor?

The greatest common factor is the biggest whole number that divides every number in a list with nothing left over. For 84 and 126 it’s 42, because 84 = 2 × 42 and 126 = 3 × 42, and no bigger number divides both.

The terminology varies by textbook and region. Greatest common factor (GCF), highest common factor (HCF) and greatest common divisor (GCD) all describe the same value.

Three ways to find the GCF

List the factors

Write out every factor of each number and pick the biggest one they share. For 60, 90 and 150, the shared factors are 1, 2, 3, 5, 6, 10, 15 and 30, so the GCF is 30. It’s the easiest method to understand, but the lists get long quickly.

Compare prime factors

Split each number into primes, then multiply the primes every number has, using the smallest power that appears. For 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7, the shared part is 2 × 3 × 7 = 42. This is the method most schools teach, often with a Venn diagram.

Use the Euclidean algorithm

Divide the bigger number by the smaller one, then keep dividing the last divisor by the remainder until the remainder is 0. The last divisor is the GCF. For 2,856 and 1,836:

2,856 = 1 × 1,836 + 1,020
1,836 = 1 × 1,020 + 816
1,020 = 1 × 816 + 204
816 = 4 × 204 + 0

So the GCF is 204. This method avoids factoring and remains an efficient standard approach for large integers more than 2,000 years after it appeared in Euclid’s Elements. For three or more numbers, find the GCF of the first pair, combine that result with the next number and continue through the list.

Zero and negative numbers

Every nonzero integer divides 0, so adding zero to a list with nonzero values does not reduce its GCF: GCF(0, 15) = 15. This calculator treats an all-zero list as undefined because no greatest positive common divisor exists under that convention. Negative signs do not change the result; the GCF is reported as a nonnegative value, so GCF(−12, 18) = 6.

GCF and LCM

The least common multiple is the smallest positive value divisible by every number in the list. For two positive integers, their GCF multiplied by their LCM equals their product. For 12 and 18, GCF = 6 and LCM = 36, so 6 × 36 = 216 = 12 × 18. The calculator shows the LCM beside the GCF for comparison.

Where the GCF is useful

Simplifying fractions

Dividing the top and bottom of a fraction by their GCF puts it in lowest terms in one step. 84/126 divided by 42 top and bottom gives 2/3. Enter two numbers and the calculator shows the simplified fraction.

Cutting or tiling without waste

To cover a 240 cm × 180 cm floor with the largest square tiles that fit exactly, find GCF(240, 180) = 60. Tiles 60 cm across fit 4 along one side and 3 along the other, so you need 12 tiles and make no cuts.

Making identical packs

With 36 pencils, 48 stickers and 60 sweets, the most identical party bags you can make is GCF(36, 48, 60) = 12. Each bag gets 3 pencils, 4 stickers and 5 sweets, with nothing left over.

GCF practice questions

The numbers here are our own. Check each one with the calculator.

What is the GCF of 14, 42 and 70?

14. It divides 42 and 70 exactly, and nothing bigger than 14 can divide 14. When the smallest number divides all the others, it’s the GCF.

What is the GCF of 35 and 48?

1. 35 = 5 × 7 and 48 = 2⁴ × 3 share no prime, so they’re coprime. Neither number is prime, but they still have no common factor bigger than 1.

What is the GCF of 0 and 28?

28. Every nonzero integer divides 0, and 28 is the greatest positive divisor of 28. This calculator treats any list containing only zeros as undefined.

Can the GCF ever be bigger than the smallest number?

No. The GCF has to divide the smallest number, so it can’t be bigger than it. At most it equals the smallest number, as with 14, 42 and 70.

Does GCF × LCM always equal the product of the numbers?

Only for two numbers. For 12 and 18, 6 × 36 = 216 = 12 × 18. For 2, 4 and 8, the GCF is 2 and the LCM is 8, which multiply to 16, but 2 × 4 × 8 = 64.

Are GCF, HCF and GCD the same thing?

Yes. Greatest common factor, highest common factor and greatest common divisor are three names for the same number. Which one you see depends mainly on the country and the textbook.

← All basic math calculators