GCF Calculator

This GCF calculator finds the greatest common factor of 2 to 20 whole numbers, including negatives and zero. Enter your numbers and you'll see the GCF, every common factor, the shared prime powers and the Euclidean steps. Two numbers also get the LCM and a Bezout check.

Calculation and content reviewed by EZ Calculators Editorial Team on .

Enter values

Enter two or more signed whole numbers. The result explains their greatest shared factor, common factors, prime-power evidence, grouping meaning, and exact checks.

Build the scenario below, then calculate for a complete result report.

Runs in your browser
Whole-number set

Enter quantities to divide evenly

Enter two to twenty signed integers separated by commas, spaces, or semicolons. Signs do not change positive divisors. Do not place thousands separators inside one value because each comma begins another entry.
Enter 2 to 20 signed integers separated by commas, spaces, or semicolons. Each may contain up to 15 digits; do not use thousands separators.
Grouping cases

Test the definition and boundaries

Largest exact groups, not estimated portionsThe GCF divides every entered magnitude with no remainder and reports whether coprimality applies to the set or every pair.
Equal-group interpretations require discrete compatible quantities. A GCF of 1 means the complete set shares no larger factor, but some pairs may still share factors. The all-zero list is undefined under the greatest-positive-divisor definition.

How do you find the greatest common factor?

Find the largest number that divides every one of your numbers with no remainder. Factor each number into primes and multiply the primes they all share, using the lowest power of each. For 12, 18 and 30 that's 2 x 3 = 6. For big numbers, the Euclidean algorithm is faster: GCF(84, 30) = 6.

How to use the GCF calculator

Type two or more whole numbers, separated by commas, spaces or semicolons. You can enter up to 20 numbers with up to 15 digits each. Leave out thousands separators: 12000, not 12,000.

Press Find GCF. You'll get the greatest common factor first, then the shared prime powers and the full list of common factors. The result also shows each number divided by the GCF, whether the numbers are coprime, and the Euclidean steps. With exactly two numbers you'll also see their LCM and Bezout coefficients.

  1. Enter at least two whole numbers, for example 12, 18, 30.
  2. Make sure no number contains a comma.
  3. Press Find GCF.
  4. Read the GCF, then the shared prime powers.
  5. Use the table to check that the GCF times each quotient gives back your number.

GCF example: 12, 18 and 30

In primes, 12 is 2^2 x 3, 18 is 2 x 3^2 and 30 is 2 x 3 x 5. Only 2 and 3 appear in all three. The lowest power of each is the first power, so the GCF is 2 x 3 = 6.

Every common factor of the three numbers is a factor of 6: 1, 2, 3 and 6. Dividing through gives 2, 3 and 5, which share nothing but 1. That's your proof that 6 is the greatest.

Greatest common factor of 12, 18 and 30
NumberPrime factorsDivided by GCFCheck
122^2 x 326 x 2 = 12
182 x 3^236 x 3 = 18
302 x 3 x 556 x 5 = 30

How to find GCF with the Euclidean algorithm

Factoring gets painful with large numbers. The Euclidean algorithm skips it. Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and that remainder. When the remainder hits zero, the last divisor is the GCF.

For 84 and 30: 84 = 2 x 30 + 24, then 30 = 1 x 24 + 6, then 24 = 4 x 6 + 0. The GCF is 6. For three or more numbers, find the GCF of the first two and carry it into the next. Once the running GCF reaches 1, it can't go higher.

Formula guide
  • GCF(a, b) = GCF(b, a mod b)
  • GCF(a, b, c) = GCF(GCF(a, b), c)
  • GCF(0, a) = |a| when a is not zero

Greatest common factor of common pairs

Here are pairs that show up often in fraction and ratio problems. Each GCF was checked with the Euclidean algorithm.

GCF of common number pairs
NumbersGCFDivided by GCF
12 and 1862 and 3
14 and 2172 and 3
16 and 4082 and 5
20 and 30102 and 3
24 and 36122 and 3
36 and 60123 and 5
45 and 75153 and 5
48 and 1868 and 3
56 and 98144 and 7
84 and 30614 and 5

Using the GCF to simplify fractions and split into groups

To reduce a fraction to lowest terms, divide the top and bottom by their GCF. For 18/24 the GCF is 6, so the fraction becomes 3/4 in one step. Ratios work the same way: 12:18 becomes 2:3.

The GCF also answers "most equal groups" word problems. With 12 red, 18 blue and 30 green items, you can make 6 identical groups with nothing left over. Each group gets 2 red, 3 blue and 5 green. The GCF is the number of groups, and the quotients are what goes in each one.

GCD and HCF: same thing, different names

GCF (greatest common factor), GCD (greatest common divisor) and HCF (highest common factor) all mean the same number. US schools tend to say GCF, programmers and number theory books say GCD, and the UK and India often say HCF. This calculator works as a GCD or HCF calculator too.

A GCF of 1 means the numbers are relatively prime. With three or more numbers that doesn't mean every pair is coprime. 6, 10 and 15 have a GCF of 1, but 6 and 10 share 2, 6 and 15 share 3, and 10 and 15 share 5. The calculator reports both checks separately.

Relatively prime versus pairwise coprime
NumbersGCFRelatively prime as a setEvery pair coprime
8, 15, 491YesYes
6, 10, 151YesNo
12, 18, 306NoNo

Negative numbers and zero

The GCF is always reported as a positive number, so signs don't change it. GCF(-48, 18) is 6, the same as GCF(48, 18).

Every number divides zero, so GCF(0, 42) is 42. If every number you enter is zero, there's no greatest common factor at all, because every positive whole number divides zero. The calculator says so instead of making up an answer.

Sources

FAQ

What is the GCF of 12 and 18?

The GCF of 12 and 18 is 6. Their factors are 1, 2, 3, 4, 6, 12 and 1, 2, 3, 6, 9, 18, and the largest one on both lists is 6.

Is GCD the same as GCF?

Yes. Greatest common divisor, greatest common factor and highest common factor are three names for the same number: the largest positive whole number that divides all of your numbers evenly.

How do you find the GCF of three numbers?

Find the GCF of the first two, then the GCF of that answer and the third number. For 12, 18 and 30, GCF(12, 18) = 6 and GCF(6, 30) = 6.

What does a GCF of 1 mean?

It means no whole number bigger than 1 divides all of your numbers, so they're relatively prime. With three or more numbers, some pairs can still share a factor, like 6 and 10 in the list 6, 10, 15.

How do I use the GCF to simplify a fraction?

Divide the numerator and denominator by their GCF. For 18/24 the GCF is 6, so 18/24 simplifies to 3/4, and 3 and 4 share no factor except 1.

Can the GCF be bigger than the smallest number?

No, as long as the smallest number isn't zero. The GCF has to divide that number, so it can't be larger. It equals the smallest number when that number divides all the others.

What is the GCF of 0 and a number?

It's the number itself, without its sign. Every whole number divides zero, so GCF(0, 42) = 42. If all the inputs are zero, there is no GCF.

Can I enter decimals or fractions?

No. This calculator takes whole numbers only. To simplify a fraction, enter its numerator and denominator as two whole numbers, or use the fraction calculator.