Skip to calculator
lcmcalculator.co

GCF Calculator (Greatest Common Factor)

The Greatest Common Factor (also called Highest Common Factor or Greatest Common Divisor) is the largest positive integer that divides every number in your list without leaving a remainder. Enter your numbers below to see both the Euclidean division steps and the shared prime factors.

GCF / HCF / GCD
Greatest Common Factor Result
GCF(24, 36, 60) = 12
Companion Least Common Multiple: LCM = 360
Check the answer (every input divided by GCF is a whole number):
24 ÷ 12 = 2 ✓36 ÷ 12 = 3 ✓60 ÷ 12 = 5 ✓

Repeatedly divide the larger number by the remainder until the remainder hits 0. The last non-zero divisor is the GCF.

Step 1: Euclidean steps for 24 and 36
  • 36 = 24 × 1 + 12
  • 24 = 12 × 2 + 0→ GCF is 12
Step 2: Euclidean steps for 72 and 60
  • 72 = 60 × 1 + 12
  • 60 = 12 × 5 + 0→ GCF is 12

How the Euclidean Algorithm Finds the GCF Fast

Factoring numbers into primes works well for two-digit numbers, but what if you need the GCF of 1,071 and 462? Euclid showed over two thousand years ago that any number dividing both a and b must also divide the remainder when a is divided by b:

1,071 = 462 × 2 + 147
462 = 147 × 3 + 21
147 = 21 × 7 + 0 ← remainder is 0, so GCF(1071, 462) = 21

In just three short divisions—without testing a single prime number—you reach the exact Greatest Common Factor of 21. Once you know the GCF, you can immediately find the Least Common Multiple using LCM(a, b) = (a × b) ÷ GCF(a, b).

How Prime Factorization Differs Between GCF and LCM

Take 24 (2³ × 3¹) and 36 (2² × 3²). Both methods start from the exact same prime factor trees, and only the final rule changes:

For GCF: Minimum Overlap

Take only primes shared by both numbers, raised to the smallest exponent: 2² × 3¹ = 4 × 3 = 12.

For LCM: Maximum Coverage

Take every prime from either number, raised to the largest exponent: 2³ × 3² = 8 × 9 = 72.