GCF and LCM Calculator

Find the greatest common factor and least common multiple of two whole numbers.

GCF and LCM Calculator

Enter two whole numbers up to 1,000,000.

How it works

The greatest common factor (GCF) is the largest whole number that divides both numbers. The least common multiple (LCM) is the smallest number that both divide into.

The two are linked: GCF × LCM equals the product of the two numbers.

Formula

LCM = (a × b) ÷ GCF

Worked examples

SituationMeasureResult
12 and 18Greatest common factor (GCF)6
8 and 20Greatest common factor (GCF)4
35 and 49Greatest common factor (GCF)7

Frequently asked questions

What is GCF also called?

Greatest common divisor (GCD) or highest common factor (HCF).

When do I need the LCM?

To find a common denominator for adding fractions or when events repeat on different cycles.

What if the GCF is 1?

The numbers are coprime, and the LCM is simply their product.

Related calculators

Results are for general information only. The calculators are tested, but please double-check anything important before relying on it for financial, tax, legal or medical decisions.