Greatest Common Factor (GCF) Calculator

Enter two or more positive integers separated by spaces and press Calculate to get their greatest common factor and least common multiple.

Press Enter to calculate; Shift+Enter adds a new line.

The greatest common factor and the least common multiple appear here after you press Calculate.

How to use this GCF calculator

  1. Enter two or more positive whole numbers separated by spaces (for example: 54 24 36). Up to 100 numbers, each up to 500 digits.
  2. Press Calculate — or just press Enter in the field. The Greatest common factor (GCF) field shows the largest number that divides all of your inputs without a remainder.
  3. The Least common multiple (LCM) field shows the smallest positive number that is a multiple of all of them, with the lcm(…) expression repeated underneath.
  4. Press Reset to return to the example numbers and clear the results, or Shift+Enter to put each number on its own line.

The greatest common factor (GCF, also called greatest common divisor, GCD) of a set of numbers is the largest positive integer that divides each of them evenly. Find GCF for the numbers 8 and 12: the prime factors of 8 are 2 × 2 × 2 and the prime factors of 12 are 2 × 2 × 3, so the common prime factors give gcf(8, 12) = 2 × 2 = 4 — which is also how you reduce the fraction 8/12 to 2/3 by dividing top and bottom by 4.

The least common multiple (LCM) is the smallest positive number every input divides into evenly: lcm(8, 12) = 24. For the default example 54 24 36 the calculator returns GCF = 6 and LCM = 216. Coprime numbers like 7 and 13 share no factor, so their GCF is 1 and their LCM is their product, 91.

Every result is an exact whole number computed by arbitrary-precision integer arithmetic in your browser — numbers far beyond an ordinary calculator's 2⁵³-precision limit keep all their digits, and nothing is uploaded anywhere. Zeros, negatives, decimals and non-numeric text are rejected with a clear message instead of a result.

More math tools are in Math & Statistics.