CalcRover

GCF Calculator (Greatest Common Factor)

Enter two or more whole numbers (separated by commas or spaces) and get their greatest common factor — the largest number that divides all of them evenly. Every answer comes with the full Euclidean-algorithm steps you can copy into homework.

How the GCF is found

The greatest common factor (also called GCD, greatest common divisor, or HCF, highest common factor) of two numbers is found fastest with the Euclidean algorithm: divide the larger number by the smaller, then repeat with the divisor and the remainder until the remainder is 0. The last divisor is the GCF.

For more than two numbers, take the GCF of the first pair, then the GCF of that result with the next number, and so on. For small numbers you can also list all factors of each number and pick the largest one they share, or compare prime factorizations and multiply the common prime factors.

gcf(a, b) = gcf(b, a mod b), until the remainder is 0
gcf(a, b, c) = gcf(gcf(a, b), c)

Worked examples

Example 1: GCF of 12 and 18

Find the greatest common factor of 12 and 18.

  1. Divide 18 by 12.
    18 = 12 × 1 + 6
  2. Divide 12 by the remainder 6.
    12 = 6 × 2 + 0
  3. The remainder is 0, so the last divisor is the GCF.
    GCF(12, 18) = 6

GCF(12, 18) = 6. (Check: factors of 12 are 1, 2, 3, 4, 6, 12; factors of 18 are 1, 2, 3, 6, 9, 18.)

Example 2: GCF of 24, 36 and 60

Find the GCF of three numbers: 24, 36, 60.

  1. First pair: GCF(24, 36).
    36 = 24 × 1 + 12; 24 = 12 × 2 + 0 → 12
  2. Then that result with 60: GCF(12, 60).
    60 = 12 × 5 + 0 → 12

GCF(24, 36, 60) = 12.

Example 3: simplify the fraction 84/126 with the GCF

Reduce 84/126 to lowest terms.

  1. Find GCF(84, 126) with the Euclidean algorithm.
    126 = 84 × 1 + 42; 84 = 42 × 2 + 0 → 42
  2. Divide the numerator and denominator by 42.
    84 ÷ 42 = 2; 126 ÷ 42 = 3

84/126 = 2/3 in lowest terms.

FAQ

What is the difference between GCF and LCM?+

The GCF is the largest number that divides all the given numbers; the LCM (least common multiple) is the smallest number they all divide into. For two numbers they are linked: GCF × LCM = a × b. This calculator shows both when you enter exactly two numbers.

Are GCF, GCD and HCF the same thing?+

Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the same value — the terminology just varies between US and UK textbooks.

What is the GCF of two prime numbers?+

Two different prime numbers share no factors except 1, so their GCF is 1 (such numbers are called coprime). The GCF of a prime with one of its multiples is the prime itself, e.g. GCF(7, 21) = 7.

What is the GCF actually used for?+

Most often for simplifying fractions (divide top and bottom by their GCF) and for splitting things into the largest equal groups — for example, the biggest identical gift bags you can make from 24 pens and 36 stickers is GCF(24, 36) = 12 bags.

Can the GCF be bigger than the smallest number?+

No. The GCF divides every number in the list, so it can never exceed the smallest of them. It equals the smallest number exactly when that number divides all the others, e.g. GCF(8, 24, 40) = 8.

Related calculators