Skip to content
FigureSure
Sign in

GCF Calculator

Find the greatest common factor (GCF) of two to twenty whole numbers. You get the answer with Euclid's algorithm written out, the prime-factor method and, for numbers up to 10,000, the full factor lists, so you can follow whichever method your class uses.
  • Updated
  • Formula shown

Numbers

2 to 20 whole numbers of 1 or more, separated by commas or spaces (up to 30 digits each, no thousands separators).

Results

GCF of 48, 18 and 30
6
Greatest common factor (also called GCD or HCF)
Relatively prime?
6 divides every number
No
All common factors
1, 2, 3, 6
LCM (least common multiple)
720

The GCF of 48, 18 and 30 is 6

Step-by-step working
Method 1: Euclid's algorithm (divide, then divide the divisor by the remainder until the remainder is 0)
1. GCF(48, 18):
   48 = 2 × 18 + 12
   18 = 1 × 12 + 6
   12 = 2 × 6 + 0
   The remainder is 0, so GCF(48, 18) = 6, the last divisor.
2. GCF(6, 30):
   30 = 5 × 6 + 0
   The remainder is 0, so GCF(6, 30) = 6, the last divisor.
   So the GCF of all 3 numbers is 6.

Method 2: prime factorization (multiply the primes every number shares, each to its lowest power)
   48 = 2⁴ × 3
   18 = 2 × 3²
   30 = 2 × 3 × 5
   Shared primes at their lowest powers: 2, 3
   GCF = 2 × 3 = 6

Method 3: list the factors of each number
   Factors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48
   Factors of 18: 1, 2, 3, 6, 9, 18
   Factors of 30: 1, 2, 3, 5, 6, 10, 15, 30
   Common factors: 1, 2, 3, 6
   The greatest common factor is 6.

How to use the GCF calculator

  1. Enter two or more whole numbers separated by commas or spaces, such as 48, 18, 30.
  2. Read the GCF and whether the numbers are relatively prime. For two numbers you also see their fraction in lowest terms.
  3. Open the step-by-step working for Euclid's algorithm, the prime factorization method and, for smaller numbers, the factor lists.

The calculator accepts up to 20 numbers with up to 30 digits each and works with exact whole-number arithmetic, so even very large inputs give an exact GCF.

GCF formulas

Euclid: GCF(a, b) = GCF(b, a mod b), and GCF(a, 0) = a
Lists: GCF(a, b, c) = GCF(GCF(a, b), c)
Prime factors: GCF = product of the shared primes, each to its lowest power

The greatest common factor of a list is the largest whole number that divides every number in it with no remainder. In Euclid's rule, a and b are two whole numbers and a mod b is the remainder when a is divided by b. Any number that divides both a and b also divides that remainder, so replacing the pair (a, b) by (b, remainder) keeps the same common factors while the numbers shrink quickly. When the remainder reaches 0, the last divisor is the GCF.

Worked example: the GCF of 48, 18 and 30

Euclid's algorithm. Start with the first pair, 48 and 18:

  1. 48 = 2 × 18 + 12
  2. 18 = 1 × 12 + 6
  3. 12 = 2 × 6 + 0

The remainder is 0, so GCF(48, 18) = 6. Then GCF(6, 30): 30 = 5 × 6 + 0, so the GCF of all three numbers is 6.

Prime factorization.

  • 48 = 2⁴ × 3
  • 18 = 2 × 3²
  • 30 = 2 × 3 × 5

The primes in every number are 2 and 3, and the lowest power of each is the first power, so the GCF is 2 × 3 = 6. The 5 in 30 and the extra 2s and 3s are not shared by all three numbers, so they are left out.

Factor lists.

  • Factors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48
  • Factors of 18: 1, 2, 3, 6, 9, 18
  • Factors of 30: 1, 2, 3, 5, 6, 10, 15, 30

The factors in all three lists are 1, 2, 3 and 6, and the greatest is 6.

GCF table for common numbers

Find the row for one number and the column for the other. A 1 means the two numbers are relatively prime.

GCF23456891012151618
2212122122122
3131131313313
4214124124142
5111511151511
6232162326326
8214128124182
9131131913319
102125221102522
122341643212346
151315313531513
162141281241162
182321629263218

Simplifying fractions with the GCF

FractionGCFLowest terms
18/2463/4
45/60153/4
28/42142/3
36/84123/7
56/98144/7
120/450304/15

Tips and common mistakes

  • The GCF can't be bigger than the smallest number, and it always divides it. If your answer doesn't divide every number exactly, recheck it.
  • Don't confuse GCF with LCM. The GCF is a factor (no bigger than the numbers); the LCM is a multiple (no smaller than them). Find the other one with the LCM calculator.
  • Use Euclid for big numbers. Listing factors of a 10-digit number is impractical; Euclid's algorithm needs only a few divisions.
  • To list every factor the numbers share, not just the greatest, use the common factor calculator. To reduce a fraction and keep calculating with it, try the fraction calculator.

Frequently asked questions

What is the GCF of 48 and 18?

The GCF of 48 and 18 is 6. By Euclid's algorithm: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so the last divisor, 6, is the GCF. In prime factors, 48 = 2⁴ × 3 and 18 = 2 × 3² share 2 × 3 = 6.

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the largest whole number that divides every number in the list with no remainder. US schools tend to say GCF, the UK says HCF, and GCD is common in higher maths.

How does Euclid's algorithm work?

Divide the larger number by the smaller, then divide the smaller number by the remainder, and repeat until the remainder is 0. The last divisor is the GCF. For 1071 and 462: 1071 = 2 × 462 + 147, 462 = 3 × 147 + 21, 147 = 7 × 21 + 0, so the GCF is 21.

What does it mean when the GCF is 1?

The numbers are relatively prime (coprime): no whole number other than 1 divides all of them. 8 and 15 are coprime even though neither is prime, so the fraction 8/15 is already in lowest terms.

How do I simplify a fraction with the GCF?

Divide the numerator and the denominator by their GCF. For 18/24 the GCF is 6, so 18/24 = 3/4. Dividing by the greatest common factor reduces the fraction to lowest terms in a single step.

Was this calculator helpful?