Free GCF / HCF calculator, with steps

GCF Calculator: Greatest Common Factor of Two or More Numbers

The greatest common factor (GCF), also called the highest common factor (HCF) or greatest common divisor (GCD), is the largest number that divides all of your numbers exactly. Write each number as a product of primes and multiply the primes they share, using the lowest power: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5, so GCF(12, 18, 30) = 2 × 3 = 6.

Find the GCF (greatest common factor)

Whole numbers from 1 to 1,000,000,000,000; up to 10 numbers.

GCF of 12, 18, 30 = 6

  1. 12 = 2² × 3
  2. 18 = 2 × 3²
  3. 30 = 2 × 3 × 5
  4. Common prime factors (lowest powers): 2 × 3 = 6
  5. All common factors: 1, 2, 3, 6
Explain the steps with AI

Worked examples

Example 1: GCF of 84 and 126

Find the greatest common factor of 84 and 126.

  1. 84 = 2² × 3 × 7
  2. 126 = 2 × 3² × 7
  3. Shared primes at the lowest power: 2 × 3 × 7

GCF(84, 126) = 42. Check: 84 ÷ 42 = 2 and 126 ÷ 42 = 3, and 2 and 3 share no factor.

Example 2: Simplify the fraction 84/126

Use the GCF to reduce 84/126 to lowest terms.

  1. GCF(84, 126) = 42 (example 1)
  2. 84 ÷ 42 = 2 and 126 ÷ 42 = 3

84/126 = 2/3.

Example 3: GCF of 8 and 15

Find the GCF of 8 and 15.

  1. 8 = 2³
  2. 15 = 3 × 5
  3. No prime in common

GCF(8, 15) = 1, so 8 and 15 are coprime (relatively prime).

Three ways to find the GCF

List the factors of each number and pick the largest one they share (fine for small numbers). Prime factorization: multiply the common primes at their lowest power (shown in the steps above). Euclid's algorithm for big numbers: replace the larger number with the remainder of dividing it by the smaller one until the remainder is 0. GCF(126, 84): 126 mod 84 = 42, 84 mod 42 = 0, so the GCF is 42.

The GCF is what you divide by to simplify fractions and ratios (more in the complete GCF guide). For the smallest shared multiple instead, use the LCM calculator.

Stuck on a word problem?

Type or photograph the whole question in the MathAI GPT math solver for a step-by-step solution. On your phone, use MathAI GPT - Math Solver for iPhone or MathAI GPT for Android.

GCF calculator FAQ

Is GCF the same as HCF and GCD?

Yes. Greatest common factor (GCF), highest common factor (HCF) and greatest common divisor (GCD) are three names for the same number.

How do you find the GCF of three or more numbers?

Find the GCF of the first two, then the GCF of that result and the next number, and so on. GCF(12, 18, 30) = GCF(GCF(12, 18), 30) = GCF(6, 30) = 6.

What is the GCF of two prime numbers?

If the primes are different, their GCF is 1. Numbers whose GCF is 1 are called coprime or relatively prime.

How are GCF and LCM related?

For two numbers, GCF × LCM = a × b. For 12 and 18: GCF = 6, LCM = 36, and 6 × 36 = 216 = 12 × 18.

What is the GCF used for?

Simplifying fractions and ratios, splitting things into the largest equal groups (for example 84 red and 126 blue beads into 42 identical bags), and factoring expressions in algebra.

Related calculators