LCM and GCF Calculator
Last updated: November 5, 2026
Find the greatest common factor and least common multiple of two whole numbers.
Greatest common factor
—
- Least common multiple: —
- Product of the numbers: —
- Are the numbers coprime?: —
On this page
Quick summary: Find the greatest common factor and least common multiple of two whole numbers.
Read the complete guide
Updated reference sections in this guide are in English.
What this calculator estimates
Find the greatest common factor and least common multiple of two whole numbers.
How to use it
Enter First whole number; Second whole number. Select Calculate to update the results.
How the calculation works
The Euclidean algorithm finds the greatest common factor, and the least common multiple is the absolute product divided by that factor.
Worked example: starting scenario
| First whole number | 84 |
|---|---|
| Second whole number | 126 |
| Greatest common factor | 42 |
|---|---|
| Least common multiple | 252 |
| Product of the numbers | 10,584 |
| Are the numbers coprime? | No |
Important limitations
Inputs must be nonzero whole numbers within ordinary browser integer precision.
Exact products and common factors
For 18 and 24, the greatest common factor is 6 and the least common multiple is 72. The identity |a×b| = GCF × LCM checks the result. Inputs must be nonzero safe integers; the LCM and product use integer arithmetic so multiplying two valid components does not silently round the result. Signs do not change the positive common factor or multiple.