Pro Calculators and Guides

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.

Saizul Amin
Saizul Amin15 Oct 2026 · Updated 17 Oct 2026 · 1 min read
How to Find the LCM and GCF (HCF) of Numbers, With Prime Factorisation

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

  1. Enter numbers separated by commas or spaces.
  2. 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.
Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages