GCF Calculator

Your Results

The greatest common factor of 12, 18 and 30 is 6, the largest number that divides all of them evenly (12 ÷ 6 = 2, 18 ÷ 6 = 3, 30 ÷ 6 = 5). They share 4 common factors: 1, 2, 3 and 6. In prime factors the GCF is 2 × 3.

6
GCF of 12, 18, 30
1, 2, 3, 6
Common Factors
2 × 3
GCF in Prime Factors
2, 3, 5
Each Number ÷ GCF
No
Relatively Prime

Need the smallest number they all divide into instead? Open the LCM Calculator with these numbers.

NumberPrime FactorsAs Powers
122 × 2 × 322 × 3
182 × 3 × 32 × 32
302 × 3 × 52 × 3 × 5
GCF62 × 3

Take only the primes every number has, each at the lowest power found in any one number, and multiply them.

What Is the Greatest Common Factor?

The greatest common factor (GCF) is the largest whole number that divides two or more numbers evenly. It goes by several names: the greatest common divisor (GCD), the highest common factor (HCF) and the greatest common measure all mean the same thing. For 12 and 18 it's 6: both are in the 6 times table, and no bigger number divides both.

  • Simplifying fractions: divide the top and bottom by their GCF. 18/30 becomes 3/5, because the GCF of 18 and 30 is 6.
  • Splitting into equal groups: with 12 apples and 18 oranges, the most identical bags you can make, using every piece of fruit, is 6.
  • Relatively prime (coprime): numbers whose GCF is 1, such as 8 and 15, share no factor except 1.

Which calculator should I use?

  • GCF Calculator: the largest number that divides all of your numbers, as when simplifying a fraction.
  • LCM Calculator: the smallest number all of your numbers divide into, as when finding a common denominator to add fractions.

How to Calculate the GCF

The quickest way for two numbers is Euclid's method, over 2,000 years old and still what computers use. Replace the bigger number with the remainder after dividing, and repeat:

GCF(a,b)= GCF(b,amodb)
  • a and b: the two numbers, with a the bigger one.
  • a mod b: the remainder when a is divided by b.
  • When the remainder reaches 0, the last number you divided by is the GCF. For three or more numbers, find the GCF of the first two, then of that answer and the next number.

Other ways to find it:

  • Prime factorization: break each number into primes and multiply only the primes every number has, each at its lowest power. For 72 and 108 that's 2² × 3² = 36.
  • Ladder (cake) method: divide all the numbers by a prime that goes into every one of them, and repeat until none does. Multiply the primes down the side.
  • Listing factors: write out every factor of each number and pick the biggest one on every list. Easy for small numbers, slow for big ones.

Example

Euclid's method for 48 and 18:

  • 48 ÷ 18 = 2, remainder 12
  • 18 ÷ 12 = 1, remainder 6
  • 12 ÷ 6 = 2, remainder 0
  • The remainder is 0, so the GCF is 6.

And by prime factors for 12, 18, 30:

  • 12 = 2 × 2 × 3
  • 18 = 2 × 3 × 3
  • 30 = 2 × 3 × 5
  • Every number has one 2 and one 3, so the GCF = 2 × 3 = 6. Its factors, 1, 2, 3, 6, are the common factors.

How to Use the GCF Calculator

"What's the greatest common factor of 12, 18 and 30, and how do I show the work?" This calculator answers that.

Let's enter the numbers for this example in the box. They are already filled in when the calculator opens, so you can follow along and then change them to your own.

  • Numbers: Enter 12, 18, 30. Use from 2 to 10 whole numbers, each from 1 up to just under 1 billion, separated by commas or spaces. Don't put commas inside a number: type 2500, not 2,500.

Calculate and Reset

Click Calculate to see your results. If the box has a problem, such as a decimal, a 0, a single number or more than 10, a message pops up under it instead. With the default numbers you get:

  • Your Results: the GCF (6) with each number divided by it, the common factors, and the GCF in prime factors.
  • GCF: the headline number, 6.
  • Common Factors: 1, 2, 3, 6, every number that divides all of them.
  • GCF in Prime Factors: 2 × 3.
  • Each Number ÷ GCF: 2, 3, 5. These share no common factor, which is how a fraction looks once it's fully simplified.
  • Relatively Prime: No, because the GCF is bigger than 1.
  • LCM Calculator link: opens the LCM Calculator with the same numbers filled in.
  • Primes, Ladder, Euclid and All Factors: four tables that show the working each way, so you can follow the method your class uses.
  • Share Results: a link that opens this calculator with your numbers filled in. Copy it, or share it on Facebook or X.

Click Reset to put the box back to 12, 18, 30 and show the default results again.