Greatest Common Factor Calculator Formula
Understand the math behind the greatest common factor calculator. Each variable explained with a worked example.
Formulas Used
Gcf
gcf = gcd(a, b)Lcm Val
lcm_val = lcm(a, b)Product
product = a * bVariables
| Variable | Description | Default |
|---|---|---|
a | First Number | 48 |
b | Second Number | 36 |
How It Works
How to Find the Greatest Common Factor
Methods
Method 1: Prime Factorization 1. Find the prime factors of each number 2. Identify the common prime factors 3. Multiply the common factors together
Method 2: Euclidean Algorithm 1. Divide the larger number by the smaller 2. Replace the larger number with the remainder 3. Repeat until the remainder is 0 4. The last non-zero remainder is the GCF
Useful Identity
GCF(a, b) × LCM(a, b) = a × b
Worked Example
Find the GCF of 48 and 36.
a = 48b = 36
- 01Prime factorization of 48: 2⁴ × 3 = 2 × 2 × 2 × 2 × 3
- 02Prime factorization of 36: 2² × 3² = 2 × 2 × 3 × 3
- 03Common factors: 2² × 3 = 4 × 3
- 04GCF(48, 36) = 12
Ready to run the numbers?
Open Greatest Common Factor Calculator