LCM and GCF Calculator

Least common multiple and greatest common factor (HCF)

Find the least common multiple (LCM) and greatest common factor (GCF, also called HCF) of two or more numbers, with the prime factorisation of each.
Share
Try an example:
Your result will appear here as you type.

About LCM and GCF Calculator

Formula

LCM(a, b) = a × b ÷ GCF(a, b)

Worked examples

12, 18 and 30

12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. GCF = 2 × 3 = 6; LCM = 2² × 3² × 5 = 180.

How it works

  1. Each number is broken into prime factors.
  2. GCF (HCF) = the primes all numbers share, at their lowest power.
  3. LCM = every prime that appears, at its highest power.

What you need

  • Two or more whole numbers.

Tips

  • For two numbers, LCM × GCF = the product of the numbers.
  • Use the LCM as the common denominator when adding fractions.

Limitations

  • Whole numbers up to 1 trillion, up to 30 numbers.

Runs in your browser. Calculations run in your browser - nothing you enter is sent anywhere.

Definitions

GCF / HCF
The largest number that divides all of them.
LCM
The smallest number all of them divide into.

Frequently asked questions

Is HCF the same as GCF?+

Yes - highest common factor (HCF) and greatest common factor (GCF, or GCD) mean the same thing.

Was this calculator helpful?