How to Find the LCM and GCF (HCF) of Numbers, With Prime Factorisation
Calculate the least common multiple and greatest common factor of two or more numbers, with step-by-step methods and uses.

The greatest common factor (also called HCF or GCD) and the least common multiple (LCM) are the two numbers you need every time you work with fractions, ratios or repeating events.
Quick answer
Enter two or more whole numbers. You get the GCF, the LCM and the prime factorisation of each number.
Method: prime factorisation
Take 12 and 18.
- 12 = 2 × 2 × 3
- 18 = 2 × 3 × 3
GCF: multiply the primes both numbers share, using the lowest power: 2 × 3 = 6. LCM: multiply all primes using the highest power: 2² × 3² = 36.
A handy check: GCF × LCM = product of the two numbers (6 × 36 = 12 × 18 = 216).
Where you use them
- GCF simplifies fractions: 12/18 = 2/3 after dividing by 6.
- LCM gives a common denominator: 1/12 + 1/18 uses 36.
- Scheduling: two buses come every 12 and 18 minutes; they meet again after 36 minutes.
- Tiling and cutting: the largest square tile that fits a 12 × 18 floor is 6 × 6.
Steps
- Enter numbers separated by commas or spaces.
- Read the GCF, LCM and factorisations.
Tips
- For more than two numbers, the tool finds the GCF and LCM across all of them.
- GCF of 1 means the numbers are "co-prime".
- Large numbers work, but the factorisation may take a moment.



