GCF and LCM calculator

Enter two or more whole numbers to get their GCF and LCM.

Tier 0 · browser · unlimited

Whole numbers

Greatest common factor (GCF)
6
Least common multiple (LCM)180

GCF and LCM in practice

The greatest common factor is the largest number that divides all your numbers exactly. You use it to simplify fractions (18/24 → divide both by 6 → 3/4) and to split things into equal groups. The least common multiple is the smallest number all of them divide into. You use it to add fractions with different denominators and to find when repeating events line up: buses every 12 and 18 minutes leave together every 36 minutes.

Worked example with Euclid's algorithm

GCF of 48 and 18: 48 = 2 × 18 + 12; 18 = 1 × 12 + 6; 12 = 2 × 6 + 0. The last non-zero remainder, 6, is the GCF. Then LCM = 48 × 18 ÷ 6 = 144.

For three numbers, apply it in steps: GCF(8, 12, 20) = GCF(GCF(8, 12), 20) = GCF(4, 20) = 4, and LCM(8, 12, 20) = 120.

How this works

The page reads your whole numbers as exact big integers and applies Euclid's algorithm: replace the larger number by the remainder of dividing it by the smaller, until the remainder is zero. The last non-zero number is the greatest common factor. The least common multiple of two numbers is their product divided by their GCF; for more numbers both are computed step by step from left to right. Results are exact for numbers of any length. Everything runs in your browser.

Frequently asked

Is GCF the same as GCD and HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

What is the LCM used for?

Adding fractions with different denominators, and finding when repeating cycles coincide.

What if the GCF is 1?

The numbers are coprime: they share no factor other than 1, and their LCM is their product.

Can I use more than two numbers?

Yes. Separate them with commas or spaces.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/calculators/math/gcf-lcm-calculator/