Factor Calculator

GCF Calculator

Find the greatest common factor (also called HCF or GCD) of two or more numbers, with three worked methods.

Enter two or more numbers

Greatest common factor

Loading calculator…

The greatest common factor of a set of numbers is the largest whole number that divides every one of them exactly. For example, the GCF of 48 and 60 is 12. This calculator handles two to five numbers and shows the full working for all three standard methods, so you can check your own answer step by step. To see every shared factor rather than just the largest, use the common factors calculator.

GCF, HCF, and GCD — the same thing

These three names describe an identical idea and are used interchangeably around the world:

  • GCF — greatest common factor (common in the US)
  • HCF — highest common factor (common in the UK, India, and Pakistan)
  • GCD — greatest common divisor (common in mathematics and computer science)

Whichever term your textbook uses, the calculation is the same, and this calculator handles all of them.

Method 1 — Listing factors

The most intuitive method: write out all factors of each number and find the largest one they share.

Worked example — GCF of 24 and 36:

  • Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
  • Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
  • Shared factors: 1, 2, 3, 4, 6, 12

The largest shared factor is 12, so GCF(24, 36) = 12.

This method is clear for small numbers but slow for large ones — you can use the factor calculator to list factors quickly.

Method 2 — Prime factorization

Break each number into primes, then take the lowest power of every prime that appears in all of them.

Worked example — GCF of 48 and 60:

  • 48 = 2⁴ × 3
  • 60 = 2² × 3 × 5
  • Shared primes: 2 (lowest power 2²) and 3 (lowest power 3¹)

GCF = 2² × 3 = 12. The prime 5 is excluded because it appears only in 60.

You can factorize any number with the prime factorization calculator.

Method 3 — The Euclidean algorithm

The fastest method, and the one computers use. Divide the larger number by the smaller, keep the remainder, and repeat until the remainder is 0.

Worked example — GCF of 1071 and 462:

  • 1071 = 462 × 2 + 147
  • 462 = 147 × 3 + 21
  • 147 = 21 × 7 + 0

The last non-zero divisor is 21, so GCF(1071, 462) = 21. Notice this took only three steps, while listing all factors of 1071 would take far longer.

The GCF and LCM relationship

For any two numbers, the GCF and the LCM are connected by a simple identity:

GCF(a, b) × LCM(a, b) = a × b

For 48 and 60: GCF is 12, LCM is 240, and 12 × 240 = 2880 = 48 × 60. This means once you know one, you can compute the other instantly.

Where the GCF is used

  • Simplifying fractions: divide numerator and denominator by their GCF. 18/24 ÷ 6 = 3/4.
  • Equal grouping: with 48 pens and 60 pencils, the GCF of 12 tells you the largest number of identical kits you can make — 4 pens and 5 pencils each.
  • Algebra: factoring out the greatest common factor is the first step in simplifying most polynomial expressions.
  • Ratios: reducing a ratio to simplest form means dividing both parts by their GCF.

Frequently Asked Questions

What is the greatest common factor (GCF)?

The greatest common factor of two or more numbers is the largest whole number that divides all of them exactly. For example, the GCF of 48 and 60 is 12, because 12 divides both evenly and no larger number does. It is also called the highest common factor (HCF) or greatest common divisor (GCD).

Is GCF the same as HCF and GCD?

Yes — GCF (greatest common factor), HCF (highest common factor), and GCD (greatest common divisor) all mean exactly the same thing. GCF and GCD are more common in the United States, while HCF is standard in the United Kingdom, India, and Pakistan.

How do you find the GCF of two numbers?

There are three standard methods. List the factors of each number and pick the largest shared one; factorize both into primes and multiply the lowest power of each shared prime; or use the Euclidean algorithm, dividing repeatedly until the remainder is zero. All three give the same answer — the Euclidean method is fastest for large numbers.

What is the Euclidean algorithm?

The Euclidean algorithm finds the GCF by repeated division. Divide the larger number by the smaller, then replace the larger with the remainder, and repeat. When the remainder reaches 0, the last non-zero divisor is the GCF. For 48 and 60: 60 = 48 × 1 + 12, then 48 = 12 × 4 + 0, so the GCF is 12.

What is the GCF of two prime numbers?

The GCF of two different prime numbers is always 1, because a prime has no divisors other than 1 and itself. For example, GCF(7, 13) = 1. Numbers whose GCF is 1 are called coprime or relatively prime.

Can the GCF be larger than the smaller number?

No. The GCF can never exceed the smallest number in the set, because it must divide that number exactly. The GCF equals the smaller number when the smaller number divides the larger one — for example, GCF(6, 24) = 6.

What is the GCF used for?

The GCF is used to simplify fractions to lowest terms, to divide items into the largest possible equal groups, and to factor out common terms in algebra. For example, simplifying 18/24 means dividing both by their GCF of 6, giving 3/4.

How do you find the GCF of three or more numbers?

Find the GCF of the first two numbers, then find the GCF of that result and the third number, and continue through the set. For 12, 18, and 24: GCF(12, 18) = 6, then GCF(6, 24) = 6. So the GCF of all three is 6.

What is the difference between GCF and LCM?

The GCF is the largest number that divides all the given numbers, while the LCM is the smallest number that all of them divide into. For 4 and 6: the GCF is 2 and the LCM is 12. They are linked by the identity GCF × LCM = product of the two numbers.

What is the GCF of a number and itself?

The GCF of any number and itself is that number. For example, GCF(15, 15) = 15, because 15 is the largest number that divides 15 exactly.