Home / Math Calculators / Greatest Common Factor Calculator

Greatest Common Factor Calculator

Find the greatest common factor (GCF), also called the greatest common divisor (GCD) or highest common factor (HCF), for two or more whole numbers. Review the prime factors and Euclidean algorithm steps.

Enter your numbers

Enter 2–15 integers separated by commas, spaces, semicolons, or new lines. Negative values are treated as their absolute values. Use at least one non-zero value.

Try an example

Your result

Greatest common factor (GCF)
12
GCF of 24, 36, 60
Least common multiple (LCM)360
Common factors6
Numbers entered3
Relatively prime?No
The common factors are 1, 2, 3, 4, 6, and 12.

Calculation details

Prime factorization

The GCF is the product of prime factors shared by every input, using the smallest power each shared prime has.

NumberPrime factorization
242³ × 3
362² × 3²
602² × 3 × 5

Euclidean algorithm steps

CalculationRemainder
36 mod 2412
24 mod 120

Common factors

1234612

Every common factor of the inputs is a factor of their GCF.

What is the greatest common factor?

The greatest common factor is the largest positive integer that divides each of the entered numbers exactly, without a remainder. It is also known as the greatest common divisor (GCD) or highest common factor (HCF).

How to calculate GCF

  1. Enter at least two whole numbers.
  2. Find the prime factorization of each number and identify the primes shared by all inputs.
  3. Multiply each shared prime using its lowest exponent. The result is the GCF.
  4. Alternatively, use the Euclidean algorithm: divide and repeatedly use the remainder until it becomes zero.

Example: GCF of 24, 36, and 60

The prime factorizations are 24 = 2³ × 3, 36 = 2² × 3², and 60 = 2² × 3 × 5. The shared prime factors at their lowest powers are 2² and 3, so GCF = 2² × 3 = 12.

Frequently asked questions

Are GCF, GCD, and HCF the same?

Yes. Greatest common factor, greatest common divisor, and highest common factor are different names for the same concept.

What does a GCF of 1 mean?

If the GCF is 1, the numbers are relatively prime (also called coprime): they share no positive factor other than 1.

Can I enter more than two numbers?

Yes. Enter between 2 and 15 integers separated by commas, spaces, semicolons, or line breaks.

How does the Euclidean algorithm work?

Divide one number by another and take the remainder. Repeat using the previous divisor and remainder. When the remainder is zero, the last non-zero divisor is the GCF.

Can I enter negative numbers?

Yes. The calculator uses the absolute value of each integer, so a number and its negative have the same GCF.