GCF / LCM Calculator

Find the greatest common factor (GCF) and least common multiple (LCM) of two or more whole numbers — enter your numbers and both results update as you type.

Enter two or more positive whole numbers, separated by commas, spaces, or new lines.
Result Live
—
Greatest Common Factor
—
Least Common Multiple

Greatest Common Factor (GCF)

Definition
The largest number that divides evenly into every number in the list   Example: GCF(12, 18) = 6, since 6 is the biggest number both divide into evenly

GCF is also called GCD (greatest common divisor) or HCF (highest common factor) — same calculation, different names depending on the textbook. It's most commonly used to simplify a fraction to its lowest terms, since dividing both the numerator and denominator by their GCF is exactly what "simplifying" means.

How to Find the GCF and LCM

You can find the GCF by looking for the largest factor shared by all the numbers. To find the LCM, look for the smallest positive multiple shared by all the numbers. For larger numbers, prime factorization provides a systematic way to find both.

Using prime factorization

For example, take 12 and 18:

Prime factorization
12 = 2 × 2 × 3 = 22 × 3 18 = 2 × 3 × 3 = 2 × 32

For the GCF, use the prime factors that appear in both numbers, using the smallest exponent of each:

GCF
GCF(12, 18) = 2 × 3 = 6

For the LCM, use every prime factor that appears, using the largest exponent:

LCM
LCM(12, 18) = 22 × 32 = 36

If you want to see the individual factors of a number first, use our Factors Calculator. You can also check whether a number is prime with our Prime Number & Checker.

Least Common Multiple (LCM)

Definition
The smallest number that every number in the list divides into evenly   Example: LCM(12, 18) = 36, since 36 is the smallest number both divide into evenly

LCM shows up most often when adding or subtracting fractions with different denominators — the least common multiple of the denominators is the smallest common denominator that lets both fractions be rewritten with matching bottoms. It's also useful for scheduling problems: if one event repeats every 12 days and another every 18, they next coincide on day 36.

How GCF and LCM relate

For any two positive integers, the GCF and LCM are related by this formula:

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

For 12 and 18:

6 × 36 = 216 12 × 18 = 216

Therefore, if you know the GCF, you can calculate the LCM with:

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

This relationship applies to two numbers. When working with three or more numbers, the GCF and LCM are found across the entire set rather than by applying the two-number product relationship directly to all of them.

Using GCF and LCM with fractions

GCF and LCM are commonly used when working with fractions. The GCF can reduce a fraction to lowest terms, while the LCM can help find a common denominator when adding or subtracting fractions.

For example, to simplify 18/24, find the GCF of 18 and 24:

GCF(18, 24) = 6 18 ÷ 6 = 3 24 ÷ 6 = 4 18/24 = 3/4

You can do the complete fraction calculation with our Simplify Fractions Calculator.

When adding or subtracting fractions with different denominators, the LCM provides the least common denominator. For example, the LCM of 6 and 8 is 24, so 24 is the smallest denominator that both fractions can be converted to.

For more fraction operations, see our Fraction Calculator.

GCF and LCM of three or more numbers

GCF and LCM can be calculated for any set of whole numbers. For example, consider 12, 18, and 24.

GCF(12, 18, 24) = 6 LCM(12, 18, 24) = 72

The GCF is the largest number that divides all three numbers evenly, while the LCM is the smallest positive number that all three numbers divide into evenly.

Frequently asked questions

What is the GCF of 12 and 18?

6. It's the largest number that divides evenly into both 12 and 18 (12 ÷ 6 = 2, 18 ÷ 6 = 3, both whole numbers).

What is the LCM of 12 and 18?

36. It's the smallest number that both 12 and 18 divide into evenly (36 ÷ 12 = 3, 36 ÷ 18 = 2, both whole numbers).

Is GCF the same as GCD?

Yes. GCF (greatest common factor), GCD (greatest common divisor), and HCF (highest common factor) all refer to the identical calculation — just different names used in different textbooks and regions.

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

Yes — enter as many numbers as needed, separated by commas, spaces, or new lines. GCF(12, 18, 24) is 6, and LCM(12, 18, 24) is 72.

What is the difference between GCF and LCM?

The GCF is the largest number that divides evenly into all the given numbers. The LCM is the smallest positive number that all the given numbers divide into evenly. GCF is commonly used for simplifying fractions, while LCM is commonly used for finding common denominators.

Is GCF the same as HCF?

Yes. GCF (greatest common factor) and HCF (highest common factor) refer to the same calculation. GCD (greatest common divisor) is another common name for the same value.

What is the GCF of a number and 1?

The GCF of any whole number and 1 is 1 because 1 is the only positive factor shared by both numbers.