GCF & LCM Calculator

Enter two or more whole numbers to get their greatest common factor and least common multiple, along with the prime factorization of each number.

Runs in your browser; nothing you type is sent anywhere. · Updated

How to use the calculator

Enter two or more positive whole numbers, separated by commas or spaces. The GCF, LCM and prime factorizations appear instantly.

Definitions

  • Greatest common factor (GCF), also called greatest common divisor (GCD): the largest number that divides all of them evenly.
  • Least common multiple (LCM): the smallest number that all of them divide into evenly.

Example: 12, 18 and 30

Number Prime factors
12 2² × 3
18 2 × 3²
30 2 × 3 × 5
  • GCF = the primes they all share, at the lowest power: 2 × 3 = 6
  • LCM = every prime that appears, at the highest power: 2² × 3² × 5 = 180

How the calculator does it

For speed, the GCF uses Euclid's algorithm: replace the larger number with the remainder of dividing it by the smaller, and repeat until the remainder is 0. For 18 and 12: 18 ÷ 12 leaves 6; 12 ÷ 6 leaves 0, so the GCF is 6.

Then LCM(a, b) = a × b ÷ GCF(a, b), applied across the list.

Where you use them

  • GCF: simplifying fractions (18/24 → divide by 6 → 3/4), or splitting items into equal groups.
  • LCM: adding fractions with different denominators, or finding when repeating schedules line up (buses every 12 and 18 minutes meet every 36 minutes).

Frequently asked questions

What is the GCF of 12 and 18?

  1. It's the largest number that divides both evenly.

What is the LCM of 4 and 6?

  1. It's the smallest number both 4 and 6 divide into.

Is GCF the same as GCD?

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