How the Least Common Factor, GCF, and LCM Are Calculated
"Least common factor" is a widely searched phrase, but mathematically it has a trivial answer: the least common factor of any set of positive integers is always 1. This calculator explains why, and then computes the two values people usually mean instead — the greatest common factor (GCF) and the least common multiple (LCM) — from the numbers you enter.
Why the least common factor is always 1
A factor of a number is any positive integer that divides it evenly, with no remainder. Since 1 divides every whole number without a remainder, 1 is a common factor of any set of integers you choose — and no smaller positive whole number exists. That makes 1 the least common factor of any two or more numbers, always. There is nothing to calculate: LCF(12, 18) = 1, LCF(7, 100) = 1, and so on for every possible input.
Finding the greatest common factor (GCF) with the Euclidean algorithm
What most people actually want is the GCF (also called the greatest common divisor, or GCD): the largest number that divides all the given numbers with no remainder. This calculator uses the Euclidean algorithm: divide the larger number by the smaller one, keep the remainder, then repeat with the smaller number and that remainder until the remainder reaches 0. The last nonzero remainder is the GCF. For 12 and 18: 18 mod 12 = 6, then 12 mod 6 = 0, so GCF(12, 18) = 6. With more than two numbers, the calculator applies the same process pairwise across the whole list.
Finding the least common multiple (LCM)
The other common target is the LCM: the smallest positive number that all the given numbers divide into evenly. It is related to the GCF by the formula LCM(a, b) = |a × b| / GCF(a, b). For 12 and 18, LCM = (12 × 18) / 6 = 36. With more than two numbers, the calculator combines them two at a time — first LCM(a, b), then LCM(that result, c), and so on — to reach the LCM of the whole list.
Common uses
The GCF is used to reduce fractions to lowest terms (divide numerator and denominator by their GCF) and to split items into the largest possible equal groups. The LCM is used to find common denominators when adding or subtracting fractions, and to schedule recurring events so they line up — for example, two buses that leave every 12 and 18 minutes both leave together every LCM(12, 18) = 36 minutes.