GCF and LCM Calculator

Find the greatest common factor (GCF/HCF) and least common multiple (LCM) of two or more numbers using prime factorization, with every factor tree and comparison shown.

Try an example:

How the GCF and LCM Calculator works

  1. Break each number into prime factors (24 = 2³ × 3, 36 = 2² × 3²).
  2. GCF: multiply the primes they share, each to its lowest power (2² × 3 = 12).
  3. LCM: multiply every prime to its highest power (2³ × 3² = 72).

Frequently asked questions

What is the difference between GCF and LCM?

The GCF is the largest number that divides all the numbers. The LCM is the smallest number that all of them divide into.

Is there a shortcut linking GCF and LCM?

For two numbers, GCF × LCM equals the product of the numbers, so LCM = (a × b) ÷ GCF.

More Arithmetic & Number Sense calculators

Browse all calculators →

MathMate can make mistakes. Please double-check important steps and calculations.