Math tools

Compare factors and multiples

GCF and LCM calculator

Find the greatest common factor and least common multiple for a list of integers, then see how each result is built.

Calculated in your browser

Formula and steps included

No account. No signup.

Formula

GCF and LCM definitions and formula

GCF(a, b) = greatest positive integer dividing both; LCM(a, b) = |a × b| / GCF(a, b) for nonzero integers

The greatest common factor is the largest positive integer that divides every value without a remainder. It is useful for reducing fractions and dividing quantities into equal groups.

The least common multiple is the smallest positive multiple shared by every nonzero value. For more than two integers, compute the GCF or LCM one pair at a time.

How to use the formula

  1. Use integer values

    Work with absolute values for factors and multiples; a negative sign does not change the positive GCF or LCM.

  2. Find the GCF

    List common factors, compare prime factorizations, or repeatedly use the Euclidean algorithm.

  3. Find the LCM

    For two nonzero integers, divide the absolute product by their GCF.

  4. Extend across the list

    Combine the first two values, then combine that result with each remaining value in turn.

Worked examples

GCF and LCM calculator examples

Two integers

For 18 and 24, the GCF is 6 and the LCM is |18 × 24| / 6 = 72.

Three integers

For 8, 12, and 20, the GCF is 4 and the LCM is 120.

Common questions

GCF and LCM calculator FAQ

When should I use GCF instead of LCM?

Use GCF to split quantities into the largest equal groups or simplify a fraction. Use LCM to find the first shared cycle, common denominator, or matching interval.

What happens when one of the numbers is zero?

The GCF of zero and a nonzero integer is the absolute value of that integer. An LCM involving zero is conventionally zero because zero is a multiple of every integer.

Do negative integers change the GCF or LCM?

No. GCF and LCM are reported as nonnegative values, so calculations use the integers' absolute values.

Does the tool save my list of integers?

Your integer list is not saved by default or uploaded. You can opt into Remember on this device or download a local JSON backup.