GCF Calculator

Find the greatest common factor (also called the greatest common divisor or highest common factor) of two or more whole numbers, with every common factor and the steps shown.

What is the greatest common factor?

The greatest common factor (GCF) is the largest whole number that divides evenly into every number in a set. It is also called the greatest common divisor (GCD) or highest common factor (HCF). The GCF of 12 and 18 is 6. You use it to simplify fractions and ratios and to split things into equal groups.

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 number in both lists is 6.

2. Prime factorization

Write each number as a product of primes and multiply the primes they share, using the lowest power. 24 = 2³ × 3, 36 = 2² × 3² and 60 = 2² × 3 × 5. They all share 2² and 3, so the GCF is 4 × 3 = 12.

3. Euclid’s method

Divide the larger number by the smaller and keep the remainder. Repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCF. For 84 and 36: 84 = 2 × 36 + 12, then 36 = 3 × 12 + 0, so the GCF is 12. This is the fastest method for large numbers.

Using the GCF to simplify fractions

Divide the top and bottom of a fraction by their GCF. 24/36 has a GCF of 12, so it simplifies to 2/3. The fraction calculator does this automatically, and the LCM calculator finds the least common multiple.

NumbersGCF
8 and 124
12 and 186
15 and 255
16 and 248
18 and 279
24 and 3612
36 and 4812
7 and 91

Frequently asked questions

What is the GCF of 12 and 18?

6. It is the largest number that divides both 12 and 18 exactly.

Is GCF the same as GCD and HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor all mean the same thing.

What if the GCF is 1?

The numbers are called relatively prime or coprime. They share no factor other than 1, like 8 and 15.

How do I find the GCF of three numbers?

Find the GCF of the first two, then the GCF of that result and the third number. Or use prime factors and keep only primes shared by all three.

What is the GCF of two prime numbers?

Always 1, unless the two numbers are the same prime.

Related calculators