GCF and LCM Calculator

Find the GCF and the LCM of a list of whole numbers at once.

Two or more, separated by commas or spaces

Try

Result

You entered12,  1812, \; 18

GCF 6,  LCM 36\displaystyle \text{GCF } 6, \; \text{LCM } 36

Check

12×18=216=6×36\displaystyle 12 \times 18 = 216 = 6 \times 36
Show the work
  1. Prime factorisation of each number

    Write each number as a product of primes, using a power where a prime repeats. The GCF and the LCM are both read off these prime powers.

    12=22×318=2×32\begin{gathered} 12 = 2^{2} \times 3 \\ 18 = 2 \times 3^{2} \end{gathered}
  2. Greatest common factor: lowest powers of shared primes

    The GCF takes only the primes that appear in every number, each to its lowest power. The shared primes are 22, 33, so multiply them to those powers.

    2×3=62 \times 3 = 6
  3. Least common multiple: highest powers of every prime

    The LCM takes every prime that appears in any number, each to its highest power, so that each number divides it. The primes used are 22, 33.

    22×32=4×9=36\begin{aligned} 2^{2} \times 3^{2} &= 4 \times 9 \\ &= 36 \end{aligned}
  4. Result

    So the GCF is 66 and the LCM is 3636.

Worked examples