LCM and GCF Calculator

Enter your numbers to get their greatest common factor, least common multiple and prime factors.

Results

GCF (greatest common factor)
6
LCM (least common multiple)
36
Prime factors of 12
2^2 × 3
Prime factors of 18
2 × 3^2

The GCF is the largest number that divides all your numbers exactly; you use it to simplify fractions and split things into equal groups. The LCM is the smallest number that all of them divide into; you use it to find a common denominator or to answer “when will these line up again?”.

The calculator works with up to four numbers and shows the prime factors of each, so you can check the result by hand.

How to calculate GCF and LCM

  1. Enter at least two positive whole numbers.
  2. Add a third and fourth number if you need to.
  3. Read the GCF, the LCM and the prime factors.

GCF and LCM formula

  • GCF: multiply the common prime factors with their lowest powers
  • LCM: multiply all prime factors with their highest powers
  • For two numbers: GCF × LCM = a × b

GCF and LCM example

12 = 2² × 3 and 18 = 2 × 3². The GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36. Indeed 6 × 36 = 12 × 18 = 216.

GCF and LCM: common questions

What does coprime mean?

Numbers whose GCF is 1 are coprime — 8 and 15, for example. Their LCM is simply their product.

Is GCF the same as GCD?

Yes. Greatest common factor, greatest common divisor and highest common factor all mean the same thing.

Which one simplifies a fraction?

The GCF. Divide numerator and denominator by it: 12/18 divided by 6 becomes 2/3.