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
| Situation | Measure | Result |
|---|---|---|
| 12 and 18 | Greatest common factor (GCF) | 6 |
| 8 and 20 | Greatest common factor (GCF) | 4 |
| 35 and 49 | Greatest 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.