DoubleCheckCalc

All tools

GCF calculator (greatest common factor)

The greatest common factor, also called HCF or GCD, with two methods shown

Type two or more whole numbers, separated by commas or spaces. The example is 48 and 36.

Such as 48, 36 or 12 18 30

–

Prime factors of each number
–
Least common multiple (LCM)
–

Working, step by step

    What the GCF is

    The greatest common factor of two or more whole numbers is the biggest number that divides all of them exactly. For 48 and 36 it is 12: 12 goes into 48 four times and into 36 three times, and no bigger number goes into both. It is also called the highest common factor (HCF), the usual name in the UK and India, or the greatest common divisor (GCD).

    Method 1: Euclid's repeated division

    Divide the bigger number by the smaller and keep the remainder. Then divide the smaller number by that remainder, and carry on until the remainder is 0. The last number you divided by is the GCF. For 48 and 36: 48 = 1 × 36 + 12, then 36 = 3 × 12 + 0, so the GCF is 12. This works quickly even for very large numbers.

    Method 2: prime factors

    Write each number as a product of primes and take the primes they share, each to the lowest power that appears. 48 = 2⁴ × 3 and 36 = 2² × 3², so the GCF is 2² × 3 = 12. The page shows each number's prime factors so you can check this way too.

    More than two numbers

    Find the GCF of the first two, then the GCF of that answer and the next number, and so on. For 12, 18 and 30, the GCF of 12 and 18 is 6, and the GCF of 6 and 30 is 6.

    Uses

    The GCF simplifies fractions (divide top and bottom by it) and ratios, and splits things into the largest equal groups. If the GCF is 1, the numbers are called coprime.

    Formula and sources

    Related tools