Free online calculator

GCF Calculator

Find the largest common divisor of a list of signed integers, for simplifying fractions or dividing quantities into equal groups. Negative inputs use their magnitudes.

Separate numbers with commas or spaces. You can calculate more than two numbers at once.

Greatest common factor
6
Numbers used
12, 18, 30

The calculator repeatedly applies the Euclidean algorithm until all entered integers have been reduced to their greatest shared factor.

Greatest common factor

  • GCF = the largest number that divides every input evenly.
  • Euclid's method: replace the larger number by the remainder until it reaches 0. GCF(24, 36): 36 mod 24 = 12, 24 mod 12 = 0 → 12.
  • Divide a fraction's top and bottom by their GCF to simplify it: 24/36 = 2/3.
  • A GCF of 1 means the numbers share no positive factor greater than 1 (they are coprime).

How to use the GCF Calculator

  1. Enter signed integers separated by commas or spaces.
  2. The parser accepts signed decimal integers, including zero and values larger than the JavaScript safe-number range, using exact integer arithmetic. Invalid entries reject the entire list.
  3. Negative inputs use their absolute magnitudes. A single integer returns its absolute value; GCF(0,n) = |n| and the all-zero result is reported as zero by convention.
  4. The first pair is processed with the Euclidean algorithm.
  5. The larger remainder sequence continues until the remainder becomes zero.
  6. The final non-zero value is the GCF for that pair.
  7. That result is combined with the next number.
  8. The process repeats until every number has been included.

Signed integers and zero convention

The Euclidean algorithm operates on exact integers. GCF(0,n) = absolute n; the all-zero list returns zero by convention. That zero is not a usable divisor for simplifying a fraction.

Examples

GCF of 12 and 18

The common positive factors include 1, 2, 3 and 6, so the greatest common factor is 6.

GCF of 24, 36 and 60

The largest integer dividing all three values without remainder is 12.

Simplifying fractions

For 18/24, GCF(18,24) = 6, so dividing both terms by 6 gives 3/4.

Relatively prime numbers

If two integers share no factor larger than 1, their GCF is 1.

Check the result in context

Signed and zero inputs: GCF(−24,36,0) = 12. GCF(0,18) = 18, while the all-zero result is 0 by the tool’s convention.

GCF and LCM of common pairs

NumbersGCFLCMFraction simplified
4 and 62122/3
6 and 82243/4
8 and 124242/3
9 and 123363/4
10 and 155302/3
12 and 186362/3
14 and 217422/3
15 and 205603/4
18 and 246723/4
24 and 3612722/3
36 and 48121443/4

Frequently asked questions

What is the difference between GCF and GCD?

They refer to the same idea: greatest common factor and greatest common divisor are two names for the largest integer dividing all values.

Can I enter more than two numbers?

Yes. The current calculator supports multiple signed integers separated by commas or spaces.

What algorithm is used?

The calculator uses the Euclidean algorithm pair by pair across the entered number list.

How is GCF used to simplify fractions?

Divide the numerator and denominator by their GCF to reduce the fraction to lowest terms.

What does a GCF of 1 mean?

It means the numbers have no common positive factor greater than 1.

How does GCF help with equal-size packs?

For 24 red and 36 blue items, 12 identical packs are possible without leftovers: each contains 2 red and 3 blue. GCF is the maximum pack count, not items per pack.

Related tools

More math tools