GCF and LCM Calculator

Find the greatest common factor, least common multiple and shared factors of your numbers. Follow the steps or use the LCM to find a common denominator.

Counting tiles arranged in equal rows beside a calculator and squared notebook

Find GCF, LCM and factors

Enter up to 20 integers and choose a method to see how the result was found.

Numbers

Try an example

How to find GCF and LCM

Use the greatest common factor (GCF) when dividing quantities into equal groups. Use the least common multiple (LCM) when looking for the first time repeating events line up.

Greatest common factor

The largest positive integer that divides every input evenly, when at least one input is nonzero. GCF is also called the greatest common divisor (GCD).

Least common multiple

For nonzero inputs, the smallest positive integer divisible by every input. The least common denominator of fractions is the LCM of their positive denominators.

  • List factors or multiples for small inputs you can compare by hand. The calculator marks the factors shared by every input.
  • Prime factorization shows the factors as prime powers. Use the lowest exponent for shared primes to find GCF, and the highest exponent of each prime to find LCM. Expand a factor tree to see each split.
  • Euclidean algorithm uses successive remainders. Combine two inputs at a time to find the GCF of a longer list.
  • GCF formula works for two nonzero integers. Apply it to each new input and the LCM found so far.
LCM(a,b)=|ab|GCF(a,b)

Try a preloaded example, enter values one at a time or paste a list. Calculator results include steps and can be copied. Recent results stay in the history while the page is open.

Euclidean and GCF formula modes accept up to 30 digits per input. Factor lists and prime factorization accept magnitudes up to 10 billion.

Worked examples

Make equal groups with GCF

You have 24 green tiles and 36 cream tiles. What is the greatest number of identical packs you can make using every tile?

24=23×3 36=22×32 GCF(24,36)=22×3=12

Make 12 packs. Each contains two green tiles and three cream tiles.

2412=23612=3

Find when events line up with LCM

Two reminders repeat every 8 and 12 days. If they both go off today, when will they next go off together?

LCM(8,12)=8×124=24

They line up again in 24 days. That is three 8-day cycles and two 12-day cycles.

Use LCM to add fractions

The least common denominator for eighths and twelfths is also 24.

18=324112=224 324+224=524

GCF and LCM questions

Common factors and GCF examples

What is a common factor?

A common factor of two or more numbers is any number that divides evenly into all of them. For example, the common factors of 12 and 18 are 1, 2, 3, and 6.

Can the GCF of two numbers be greater than either number?

For positive integers, the GCF is at most the smaller number. For two nonzero signed integers, compare their magnitudes. When one input is zero, the GCF is the magnitude of the other input.

What is the GCF of 12 and 18?

The factors of 12 are {1,2,3,4,6,12}. The factors of 18 are {1,2,3,6,9,18}. The greatest common factor is 6.

What is the GCF of 24 and 36?

The factors of 24 are {1,2,3,4,6,8,12,24}. The factors of 36 are {1,2,3,4,6,9,12,18,36}. The greatest common factor is 12.

What is the GCF of 8 and 12?

The factors of 8 are {1,2,4,8}. The factors of 12 are {1,2,3,4,6,12}. The greatest common factor is 4.

What is the GCF of 6 and 8?

The factors of 6 are {1,2,3,6}. The factors of 8 are {1,2,4,8}. The greatest common factor is 2.

What is the GCF of 6 and 9?

The factors of 6 are {1,2,3,6}. The factors of 9 are {1,3,9}. The greatest common factor is 3.

What is the GCF of 12 and 16?

The factors of 12 are {1,2,3,4,6,12}. The factors of 16 are {1,2,4,8,16}. The greatest common factor is 4.

What is the GCF of 12 and 20?

The factors of 12 are {1,2,3,4,6,12}. The factors of 20 are {1,2,4,5,10,20}. The greatest common factor is 4.

What is the GCF of 4 and 6?

The factors of 4 are {1,2,4}. The factors of 6 are {1,2,3,6}. The greatest common factor is 2.

What is the GCF of 10 and 8?

The factors of 10 are {1,2,5,10}. The factors of 8 are {1,2,4,8}. The greatest common factor is 2.

What is the GCF of 15 and 20?

The factors of 15 are {1,3,5,15}. The factors of 20 are {1,2,4,5,10,20}. The greatest common factor is 5.

What is the GCF of 16 and 24?

The factors of 16 are {1,2,4,8,16}. The factors of 24 are {1,2,3,4,6,8,12,24}. The greatest common factor is 8.

What is the GCF of 24 and 32?

The factors of 24 are {1,2,3,4,6,8,12,24}. The factors of 32 are {1,2,4,8,16,32}. The greatest common factor is 8.

What is the Least Common Factor?

Every positive integer has 1 as a divisor. The smallest positive common factor is therefore 1. Exercises usually ask for the greatest common factor, which depends on the inputs.

Common multiples and LCM examples

What is the Least Common Multiple (LCM)?

The Least Common Multiple (LCM) of two or more non-zero whole numbers is the smallest positive integer that is a multiple of all the numbers.

How to find the Least Common Multiple (LCM)?
  • List multiples. Write the positive multiples of each input until a value appears in every list.
  • Use prime factorization. For each prime, take the highest exponent found across the inputs. Multiply those prime powers.
  • Use the GCF. For two nonzero integers, LCM(a,b)=|ab|GCF(a,b)
What is a common multiple?

A common multiple of two or more numbers is any number that is a multiple of all of them. For example, common multiples of 6 and 8 include 24, 48, 72, etc.

What is the LCM of 8 and 12?

Multiples of 8: {8,16,24,32,…}. Multiples of 12: {12,24,36,…}. The least common multiple is 24.

What is the LCM of 6 and 8?

Multiples of 6: {6,12,18,24,…}. Multiples of 8: {8,16,24,32,…}. The least common multiple is 24.

What is the LCM of 6 and 9?

Multiples of 6: {6,12,18,24,…}. Multiples of 9: {9,18,27,…}. The least common multiple is 18.

What is the LCM of 9 and 12?

Multiples of 9: {9,18,27,36,…}. Multiples of 12: {12,24,36,…}. The least common multiple is 36.

What is the LCM of 4 and 10?

Multiples of 4: {4,8,12,16,20,…}. Multiples of 10: {10,20,30,…}. The least common multiple is 20.

What is the LCM of 4 and 6?

Multiples of 4: {4,8,12,…}. Multiples of 6: {6,12,18,…}. The least common multiple is 12.

What is the LCM of 3 and 4?

Multiples of 3: {3,6,9,12,…}. Multiples of 4: {4,8,12,…}. The least common multiple is 12.

What is the LCM of 10 and 12?

Multiples of 10: {10,20,30,40,50,60,…}. Multiples of 12: {12,24,36,48,60,…}. The least common multiple is 60.

What is the LCM of 3 and 5?

Since 3 and 5 are distinct primes, their LCM is their product, 3×5=15.

Zero and large numbers

Is 0 ever used when finding GCF or LCM?

For a nonzero integer, GCF(a,0)=|a|. This calculator uses GCF(0,0)=0 by convention. Zero has only one distinct multiple, zero itself. A list containing zero has no positive common multiple, so the calculator returns zero for its LCM by convention.

Which method is fastest for large numbers?

Use the Euclidean algorithm for the GCF of large integers. For two nonzero integers, the same GCF gives the LCM quickly using LCM(a,b)=|ab|GCF(a,b)

Practice with released test questions

Try the two official New York State Grade 6 questions by hand, then check each result with two methods. The PDFs open in new tabs.