GCF Calculator (Greatest Common Factor)
Find the greatest common factor of any set of numbers, with step-by-step Euclidean algorithm and prime factorizations.
➗ What is the Greatest Common Factor?
The greatest common factor (GCF) of two or more integers is the largest positive integer that divides each of them without leaving a remainder. For example, GCF(12, 18) = 6 because 6 is the largest number that divides both 12 and 18 exactly. The GCF is also called the greatest common divisor (GCD) or highest common factor (HCF) depending on the country and context, but all three names refer to the same mathematical quantity.
GCF appears in many practical situations. Simplifying fractions requires dividing numerator and denominator by their GCF: the fraction 24/36 simplifies to 2/3 by dividing both by GCF(24, 36) = 12. Dividing quantities equally uses GCF to find the largest group size with no remainder: if you have 24 apples and 36 oranges and want equal bags with both fruits in each bag, GCF(24, 36) = 12 tells you the maximum number of bags possible. Tiling and measurement problems use GCF to find the largest unit that fits exactly into multiple dimensions.
There are two standard methods to find the GCF. The Euclidean algorithm repeatedly divides the larger number by the smaller and replaces the larger with the remainder, until the remainder is 0. The last non-zero remainder is the GCF. The prime factorization method decomposes each number into prime factors and takes the product of shared primes using the lowest exponent. The Euclidean algorithm is faster for large numbers because it avoids full factorization.
A closely related value is the Least Common Multiple (LCM), which is the smallest positive integer divisible by all input numbers. GCF and LCM are linked by the formula: GCF(a, b) × LCM(a, b) = a × b. This means knowing GCF immediately gives LCM for two numbers. This calculator displays both values and shows the full Euclidean algorithm derivation so you can verify or learn the process step by step.