How to use
- Type the numbers separated by commas or spaces, for example 12, 18, 30.
- Read the GCF and LCM at the top.
- Follow the prime factorization steps and the Euclidean algorithm underneath.
Options explained
- Prime factorization method
- Write each number as a product of primes. The GCF uses the primes all numbers share, each with its lowest power; the LCM uses every prime that appears, each with its highest power.
- Euclidean algorithm
- Divide the larger number by the smaller, then the divisor by the remainder, until the remainder is 0. The last non-zero remainder is the GCF. It is fast even for very large numbers.
Worked examples
| Numbers | GCF | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 8, 12, 20 | 4 | 120 |
| 24, 36, 60 | 12 | 360 |
| 17, 23 | 1 | 391 |
When the GCF is 1, as with 17 and 23, the numbers are called coprime and their LCM is simply their product.
Where you use them
GCF simplifies fractions (divide top and bottom by the GCF) and splits things into equal groups — the largest square tile that fits a 12 × 18 floor exactly is 6 × 6.
LCM finds a common denominator for adding fractions and answers “when do they line up again” questions — buses every 12 and 18 minutes leave together again after 36 minutes.
Frequently asked questions
What is the difference between GCF, GCD and HCF?
They are the same thing — greatest common factor, greatest common divisor and highest common factor are different names used in different countries.
How are GCF and LCM related?
For two numbers, GCF × LCM = the product of the numbers. For 12 and 18, 6 × 36 = 216 = 12 × 18.
How big can the numbers be?
Each number can be up to 10^15. If the LCM is larger than about 9 × 10^15 it is shown in scientific notation.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.