Greatest Common Factor (GCF)
Calculate GCF, GCD, or HCF of two or more numbers using factorization with step-by-step work.
Calculate the Greatest Common Factor (GCF), Greatest Common Divisor (GCD), or Highest Common Factor (HCF) of two or more whole numbers with step-by-step factorization.
How to Use
Finding the Greatest Common Factor
This calculator finds the GCF (also called GCD or HCF) of two or more whole numbers using factorization. Enter your numbers separated by commas or spaces and see the complete work with all factors listed.
Three Methods to Find GCF:
- Factorization: List all factors of each number, identify common factors, select the largest
- Prime Factorization: Find prime factors of each number, multiply the common prime factors
- Euclidean Algorithm: Repeatedly subtract smaller from larger until reaching zero
This Calculator Also Finds:
- Greatest Common Factor (GCF)
- Greatest Common Divisor (GCD)
- Highest Common Factor (HCF)
What is Greatest Common Factor (GCF)?
The Greatest Common Factor (GCF) of a set of whole numbers is the largest positive integer that divides evenly into all numbers with zero remainder. It's also known as the Greatest Common Divisor (GCD) or Highest Common Factor (HCF).
For example, for the numbers 18, 30, and 42, the GCF is 6 because 6 is the largest number that divides all three evenly (18÷6=3, 30÷6=5, 42÷6=7).
Special case - GCF with zero: Any non-zero whole number k times 0 equals 0, so every non-zero integer is a factor of 0. Therefore, GCF(k, 0) = k for any whole number k. However, GCF(0, 0) is undefined.
Formula
Method 1: Factorization
1. List all factors of each number
2. Identify factors common to all numbers
3. The greatest common factor is the largest one
Method 2: Prime Factorization
1. Find prime factorization of each number
2. Identify common prime factors
3. Multiply common primes (use lowest occurrence count)
Method 3: Euclidean Algorithm
GCD(a, b) = GCD(b, a mod b)
Repeat until remainder = 0
For multiple numbers: GCF(x,y,z) = GCF(GCF(x,y), z)
Examples
Example 1: GCF(18, 27) using Factorization
Factors of 18: 1, 2, 3, 6, 9, 18
Factors of 27: 1, 3, 9, 27
Common factors: 1, 3, 9
GCF = 9
Example 2: GCF(20, 50, 120) using Prime Factorization
20 = 2 × 2 × 5
50 = 2 × 5 × 5
120 = 2 × 2 × 2 × 3 × 5
Common prime factors: 2 and 5
GCF = 2 × 5 = 10
Example 3: GCF(18, 27) using Euclidean Algorithm
27 - 18 = 9
18 - 9 - 9 = 0
GCF = 9 (last non-zero result)