GCF Calculator (Greatest Common Factor)

Enter two to ten whole numbers. You get the greatest common factor, the primes they share, and Euclid's division steps from start to finish.

Find the GCF of your numbers

Loading the calculator. It needs JavaScript.

Two ways to find the GCF

The calculator shows both methods, so you can check one against the other.

Prime factors. Write each number as a product of primes. Then keep only the primes that appear in every number, each at its smallest power. Multiply what is left.

  • 48 = 2^4 x 3
  • 180 = 2^2 x 3^2 x 5

Both contain 2 and 3. The smallest power of 2 is 2^2, and the smallest power of 3 is 3. So the GCF is 4 x 3 = 12. The 5 is dropped because 48 has none.

The Euclidean algorithm. Divide the bigger number by the smaller one and note the remainder. Then divide the smaller number by that remainder. Keep going until the remainder is 0. The last divisor you used is the GCF.

Worked example with Euclid

Here is a classic pair, 1071 and 462:

Division Remainder
1,071 = 2 x 462 + 147 147
462 = 3 x 147 + 21 21
147 = 7 x 21 + 0 0

The remainder hit 0 after dividing by 21, so the GCF is 21. Notice that you never had to factor anything. This is why the method works so well on big numbers. A theorem proved by Gabriel Lamé in 1844 says it never needs more steps than five times the number of digits in the smaller number. Euclid wrote it down in his Elements around 300 BC.

Why the division trick works

Any number that divides both 1071 and 462 must also divide 1071 - 2 x 462, which is 147. So the pair (462, 147) has exactly the same common factors as (1071, 462). Each step swaps the pair for a smaller one with the same factors. When the remainder reaches 0, the last divisor divides itself and 0, so it is the answer.

Where the GCF helps

  • Simplifying fractions. Divide the top and bottom by their GCF to get lowest terms in one step.
  • Splitting things into equal groups. With 48 red beads and 180 blue beads, the most matching bags you can make is 12. Each bag gets 4 red and 15 blue.
  • Tiles and grids. The largest square tile that fits a 48 by 180 cm floor with no cutting has 12 cm sides.
  • Ratios. A ratio of 24:36:60 reduces to 2:3:5 after dividing by 12.

GCF and LCM are partners

For two numbers, the GCF times the LCM equals the two numbers multiplied together. For 4 and 6, the GCF is 2 and the LCM is 12, and 2 x 12 = 24 = 4 x 6. The calculator shows the LCM as well. For lists of multiples and the LCM working, use the LCM calculator.

What you can type

Up to 10 whole numbers, each up to 18 digits. The maths uses exact big integers, so long numbers never get rounded. A minus sign is ignored, since -12 and 12 have the same factors. Decimals and words are skipped with a note. The prime factor rows appear when every number is one trillion or less. Above that, the Euclid steps still give the exact answer.

Questions

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for one number: the biggest whole number that divides every number in your list with nothing left over.

How do I simplify a fraction with the GCF?

Find the GCF of the top and bottom, then divide both by it. For 42/56 the GCF is 14, so the fraction becomes 3/4. The calculator shows each number divided by the GCF, which is the simplified fraction.

What does it mean when the GCF is 1?

The numbers share no factor except 1. They are called coprime, or relatively prime. 9 and 28 are an example, even though neither one is prime.

What is the GCF of a number and 0?

It is the number itself, because every number divides 0. The GCF of 15 and 0 is 15. That is why the tool leaves zeros out: they never change the answer.

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 third number, and carry on down the list. The calculator does this for you and shows each pair.

Facts checked 2026-11-29. Sources: Greatest common divisor (Wikipedia), Euclidean algorithm (Wikipedia).

Related tools