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
Try an example
Your result
Calculation details
Prime factorization
The GCF is the product of prime factors shared by every input, using the smallest power each shared prime has.
| Number | Prime factorization |
|---|---|
| 24 | 2³ × 3 |
| 36 | 2² × 3² |
| 60 | 2² × 3 × 5 |
Euclidean algorithm steps
| Calculation | Remainder |
|---|---|
| 36 mod 24 | 12 |
| 24 mod 12 | 0 |
Common factors
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
- Enter at least two whole numbers.
- Find the prime factorization of each number and identify the primes shared by all inputs.
- Multiply each shared prime using its lowest exponent. The result is the GCF.
- 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.