GCF and LCM Calculator

Find the greatest common factor (GCF) and least common multiple (LCM) of two or more numbers, with prime factorization and common factors

Last updated: November 5, 2026

How to Use the GCF and LCM Calculator

How to use the GCF and LCM calculator

  1. Type your numbers. Enter two to ten positive whole numbers, separated by commas, spaces or new lines. You can paste a column straight from a spreadsheet.
  2. Read the GCF and LCM. Both appear as you type, together with every common factor and the first few common multiples.
  3. See the prime factorization. The table shows each number as a product of primes and how many factors it has.
  4. Simplify a fraction (two numbers). With exactly two numbers, the calculator also shows them as a simplified fraction, such as 24/36 = 2/3.

If two numbers have a GCF of 1 they are called relatively prime (or coprime), and their LCM is simply their product.

Formula & Methodology

What are the GCF and LCM?

The greatest common factor (GCF) of two or more numbers is the largest number that divides all of them exactly. It is also called the greatest common divisor (GCD) or highest common factor (HCF).

The least common multiple (LCM) is the smallest positive number that every one of them divides into exactly.

For 24 and 36 the GCF is 12 and the LCM is 72.

How to find the GCF and LCM with prime factorization

  1. Break each number into primes. 24 = 2³ × 3 and 36 = 2² × 3².
  2. GCF: take each prime that appears in every number, with the smallest exponent. Here that is 2² × 3 = 12.
  3. LCM: take every prime that appears in any number, with the largest exponent. Here that is 2³ × 3² = 72.

The Euclidean algorithm

For two numbers, repeatedly divide and keep the remainder until it reaches 0. The last non-zero remainder is the GCF.

GCF(36, 24): 36 ÷ 24 leaves 12, and 24 ÷ 12 leaves 0, so the GCF is 12.

The GCF and LCM are linked

For any two numbers:

GCF(a, b) × LCM(a, b) = a × b

Check with 24 and 36: 12 × 72 = 864 = 24 × 36. This is a quick way to find the LCM once you know the GCF: LCM = (a × b) ÷ GCF.

Three or more numbers

Apply the same rules to the whole list. For 12, 18 and 24:

  • 12 = 2² × 3, 18 = 2 × 3², 24 = 2³ × 3
  • GCF = 2 × 3 = 6
  • LCM = 2³ × 3² = 72

What each one is used for

  • Simplifying fractions: divide the numerator and denominator by their GCF. 24/36 becomes 2/3.
  • Adding fractions: the LCM of the denominators is the least common denominator.
  • Scheduling: if one event repeats every 12 days and another every 18, they coincide every LCM(12, 18) = 36 days.
  • Splitting evenly: the GCF is the biggest group size that divides several totals with nothing left over.

About GCF and LCM Calculator

Our gcf and lcm calculator is a free, easy-to-use tool designed to help youfind the greatest common factor (gcf) and least common multiple (lcm) of two or more numbers, with prime factorization and common factors. If you're a professional or just need quick calculations, our calculator provides accurate results instantly.

Frequently Asked Questions

How do you find the GCF of two numbers?

List the prime factors of each number and multiply the primes they share, using the lowest power of each. For 24 (2³ × 3) and 36 (2² × 3²), the shared part is 2² × 3 = 12. You can also use the Euclidean algorithm: divide the larger number by the smaller, then repeat with the remainder until it is 0.

How do you find the LCM of two numbers?

Take every prime that appears in either number with its highest power and multiply them. For 24 and 36 that gives 2³ × 3² = 72. A shortcut is LCM = (a × b) ÷ GCF, so (24 × 36) ÷ 12 = 72.

What is the difference between GCF and LCM?

The GCF is the largest number that divides all your numbers, so it is never larger than the smallest one. The LCM is the smallest number that all of them divide into, so it is never smaller than the largest one.

Is GCF the same as GCD or HCF?

Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) all mean the same thing. Different countries and textbooks prefer different names.

What is the GCF of two prime numbers?

It is 1, because two different primes share no factor other than 1. The numbers are then called relatively prime, and their LCM is their product. For example, GCF(7, 13) = 1 and LCM(7, 13) = 91.

How do I use the GCF to simplify a fraction?

Divide the numerator and the denominator by their GCF. For 24/36 the GCF is 12, so the fraction simplifies to 2/3. The result is in lowest terms because 2 and 3 have no common factor left.

Can I find the GCF and LCM of more than two numbers?

Yes. Find the GCF or LCM of the first two numbers, then combine the result with the third, and so on. This calculator handles up to ten numbers at once. For 12, 18 and 24 the GCF is 6 and the LCM is 72.

Enter your values

Two to ten whole numbers, separated by commas, spaces or new lines

Your result will appear here

Loading…