LCM and GCF calculator.

The LCM (least common multiple) is the smallest positive number that every number in the list divides evenly. The GCF (greatest common factor, also called GCD) is the largest number that divides every number in the list. For 12 and 18, the prime factors are 2² × 3 and 2 × 3², so the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.

Updated Typed values never leave your browser

LCM and GCF of a list of numbers

Enter two or more positive whole numbers. The prime factorization shows step by step.

Tab next field Ctrl K search for another tool
LCMcalterix
180
GCF = 6. Factorization: LCM = 2² × 3² × 5; GCF = 2 × 3
  • 12 =2² × 3
  • 18 =2 × 3²
  • 30 =2 × 3 × 5
  • GCF: shared primes, lowest powers2 × 3
  • LCM: every prime, highest powers2² × 3² × 5
  • GCF6
  • LCM180

How to find the LCM and GCF

The safest method is to break each number into prime factors. The GCF uses only the primes that appear in every number, each with its lowest power. The LCM uses every prime that appears in any number, each with its highest power.

GCF = product of the shared primes, lowest powers
LCM = product of all primes, highest powers
For two numbers: LCM × GCF = a × b
The shortcut LCM × GCF = a × b works for two numbers only.

LCM and GCF are the engine behind adding fractions (common denominator) and simplifying them. See the fraction calculator, which uses both.

Worked examples

NumbersPrime factorsGCFLCM
12 and 182² × 3 and 2 × 3²636
12, 18, and 302² × 3, 2 × 3², 2 × 3 × 56180
8 and 152³ and 3 × 51120
24 and 362³ × 3 and 2² × 3²1272
7 and 147 and 2 × 7714
Answers checked by hand.

For 8 and 15, no prime repeats, so the GCF is 1 (the numbers are called relatively prime or coprime) and the LCM is the plain product, 8 × 15 = 120.

When to use the LCM and GCF

  • LCM: when events repeat on cycles. Buses that leave every 12 and 18 minutes depart together every 36 minutes.
  • LCM: a common denominator for adding or subtracting fractions.
  • GCF: splitting into equal groups with nothing left over. With 12 sophomores and 18 juniors, the most equal teams you can make is 6.
  • GCF: simplifying fractions. 18/24 divides by 6 and becomes 3/4.
The field accepts positive whole numbers up to 1 trillion. Zero, negatives, and decimals are left out because LCM and GCF are defined here for positive whole numbers.

To compare quantities, use the proportion calculator. For general math, the scientific calculator covers the rest.

Frequently asked questions

How do you find the LCM of two numbers?

Break both numbers into primes and multiply every prime with its highest power. For 12 (2² × 3) and 18 (2 × 3²), the LCM is 2² × 3² = 36.

How do you find the GCF of two numbers?

Break both numbers into primes and multiply only the shared primes, each with its lowest power. For 12 and 18, the GCF is 2 × 3 = 6. The Euclidean algorithm, which uses repeated division, gets the same answer.

What is the difference between LCM and GCF?

The LCM is the smallest common multiple and is always at least as big as the largest number. The GCF is the largest common factor and is never bigger than the smallest number. For 12 and 18, they are 36 and 6.

Is GCF the same as GCD?

Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the same number. Some textbooks also say HCF, for highest common factor.

How do you find the LCM and GCF of three or more numbers?

The method stays the same: factor every number. The GCF uses the primes present in all of them, and the LCM uses all primes. For 12, 18, and 30, the GCF is 6 and the LCM is 180.

When is the GCF equal to 1?

The GCF is 1 when the numbers share no prime, which makes them relatively prime. That is the case for 8 and 15, and then the LCM is the product of the numbers: 120.

Sources and method

  • Elementary number theory: prime factorization, LCM, and GCF