AI Tools Free

GCF Calculator

Paste 2 to 100 whole numbers separated by commas, spaces, or line breaks into this GCF calculator to compute their largest shared divisor in one click. All calculations run locally in your browser with exact BigInt precision up to 1 billion.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate result.

Separate up to 100 integers with commas, spaces or new lines. Each integer must have an absolute value no greater than 1 billion. At least one must be nonzero.

Your result
Enter your details

Result will appear here

How this GCF calculator finds the greatest common factor

This GCF calculator parses comma-, space-, or line-separated integers and applies iterative Euclidean division in client-side JavaScript.

For two integers a and b, the Euclidean algorithm replaces the larger value with the remainder of dividing the pair: gcd(a, b) = gcd(b, a mod b) until the remainder reaches 0. The final nonzero divisor is the GCF.

When you enter three or more numbers, the calculator folds the list from left to right: GCF(a, b, c) = gcd(gcd(a, b), c). Negative signs are stripped automatically because gcd(-a, b) equals gcd(|a|, |b|). You can enter up to 100 integers up to 1,000,000,000 as long as at least one integer is nonzero.

Euclidean remainder steps reducing 48 and 180 down to their greatest common factor of 12.
Euclidean division reduces a pair of integers to their greatest common factor in a few modulo steps.

Common GCF, prime factorization, and LCM lookup table

Compare shared prime powers, the resulting GCF (also called HCF or GCD), the reduced fraction or ratio after dividing by the GCF, and the matching least common multiple (LCM) for common integer sets.

IntegersPrime factorizationGCF (HCF / GCD)Simplified fraction or ratioLCM
12 and 1812 = 2^2 x 3; 18 = 2 x 3^262/3 (2 : 3)36
16 and 2416 = 2^4; 24 = 2^3 x 382/3 (2 : 3)48
18 and 2718 = 2 x 3^2; 27 = 3^392/3 (2 : 3)54
24 and 3624 = 2^3 x 3; 36 = 2^2 x 3^2122/3 (2 : 3)72
30 and 4530 = 2 x 3 x 5; 45 = 3^2 x 5152/3 (2 : 3)90
36 and 4836 = 2^2 x 3^2; 48 = 2^4 x 3123/4 (3 : 4)144
48 and 18048 = 2^4 x 3; 180 = 2^2 x 3^2 x 5124/15 (4 : 15)720
54 and 7254 = 2 x 3^3; 72 = 2^3 x 3^2183/4 (3 : 4)216
35 and 6435 = 5 x 7; 64 = 2^6 (no shared primes)1 (coprime)35/64 (irreducible)2,240
60, 84, and 108Shared prime powers: 2^2 x 3125 : 7 : 93,780

How to calculate GCF for two or more numbers

Follow these three steps in the greatest common factor calculator to solve homework problems, reduce fractions, or check multi-number batches.

Enter 2 to 100 whole numbers

Type or paste your integers into the Integers box (pre-filled with 48, 180). Separate values with commas, spaces, or line breaks pasted from a spreadsheet column.

Integers input
GCF Calculator input box pre-filled with 48, 180 and comma-separated integer instructions.
Enter 2 to 100 integers separated by commas, spaces, or line breaks.

Check signs, zeros, and range limits

Keep each value within an absolute magnitude of 1,000,000,000 and include at least one nonzero integer. Negative numbers use their positive magnitude, and any 0 follows gcd(a, 0) = |a|.

Calculated GCF
GCF Calculator result panel showing a greatest common factor of 12 for 48 and 180.
The output panel displays the positive greatest common divisor for your integer list.

Calculate and copy or download the GCF

Select Calculate result to display the largest shared divisor in the output card. Use Copy result to copy the value to your clipboard or Download to save a plain-text result.txt file.

Copy or download
GCF Calculator workspace showing the input list, GCF result of 12, and Copy result and Download buttons.
Copy the GCF to your clipboard or download the result as a plain-text file.

Worked greatest common factor examples

These three examples show how Euclidean remainder division and prime factorization produce the same GCF across pairs, three-number batches, and coprime integers.

Simplifying a fraction (48 and 180)

By Euclidean division, 180 = 3 x 48 + 36, then 48 = 1 x 36 + 12, and 36 = 3 x 12 + 0. Because 12 is the last nonzero remainder, GCF(48, 180) = 12 and 48/180 reduces to 4/15.

Simplifying the fraction 48/180 to 4/15 by dividing numerator and denominator by GCF(48, 180) = 12.
Dividing 48 and 180 by their GCF of 12 reduces 48/180 to 4/15 in one step.

Grouping three quantities (60, 84, and 108)

First compute gcd(60, 84) = 12, then pass that intermediate divisor into gcd(12, 108) = 12. Packing 60 bolts, 84 washers, and 108 nuts into equal kits yields at most 12 kits with 5 bolts, 7 washers, and 9 nuts each.

Folding GCF across three quantities (60, 84, and 108) to divide hardware parts into 12 equal kits.
Chaining gcd(gcd(60, 84), 108) = 12 finds the maximum number of identical kits.

Testing coprime integers (35 and 64)

Prime factorization splits 35 into 5 x 7 and 64 into 2^6. Because the two integers share no prime factors, the calculator returns GCF = 1, confirming that 35 and 64 are coprime and 35/64 is irreducible.

Prime factor comparison of 35 (5 x 7) and 64 (2^6) showing no shared prime factors and GCF = 1.
When two integers share no prime factors, their GCF is 1 (coprime).

What your GCF result means for fractions and LCM

Use the returned greatest common factor to reduce fractions, simplify multi-part ratios, or compute the least common multiple.

When the GCF is greater than 1, every integer in your input list is evenly divisible by that factor. Divide each original integer by the GCF to reduce a fraction or a three-part ratio to lowest whole-number terms in one step, or verify the reduced form with the Fraction Simplifier.

When the output is 1, your numbers are relatively prime and cannot be reduced further. For two positive integers a and b, you can also pair this with an LCM Calculator workflow using LCM(a, b) = (a x b) / GCF(a, b).

Using GCF(a, b) to reduce a fraction to lowest terms and compute LCM(a, b) = (a x b) / GCF(a, b).
Divide by the GCF to simplify ratios, or use (a x b) / GCF(a, b) to find the least common multiple.

GCF calculator input rules, zeros, and decimal workarounds

Check how decimals, zeros, and negative signs are handled before running a large batch.

Greatest common factors are defined strictly on integers. To find the GCF of decimals like 1.2 and 1.8, multiply both by 10 to get 12 and 18, find GCF(12, 18) = 6, and divide by 10 to get 0.6. You can also inspect individual prime factors with the Prime Factorization Calculator.

Because every nonzero integer divides 0, including 0 alongside nonzero numbers leaves the GCF unchanged: gcd(48, 0) = 48. Entering only zeros is rejected because 0 has no finite largest divisor.

Scaling decimal numbers by powers of 10 before computing the integer GCF and dividing back.
Scale decimals by 10^k to whole numbers before computing their GCF, and include at least one nonzero integer.

Frequently asked questions about greatest common factors

Answers to common questions about GCF, GCD, and HCF calculations, three-number inputs, zeros, and algebraic variables.

What is the difference between GCF, GCD, and HCF?

Greatest Common Factor (GCF), Greatest Common Divisor (GCD), and Highest Common Factor (HCF) all name the exact same quantity: the largest positive integer that divides every number in a set with zero remainder. US textbooks usually write GCF, UK and Commonwealth curricula write HCF, and programming libraries (such as Python's math.gcd) use GCD.

How do I calculate the GCF of 3 or more numbers?

Paste all integers into the input box separated by commas or spaces, such as 24, 60, 96. The tool finds the GCF of the first two integers (gcd(24, 60) = 12) and then computes the GCF of that result with the third integer (gcd(12, 96) = 12), continuing across up to 100 numbers.

Which GCF method is fastest: listing factors, prime factorization, or Euclidean division?

Listing all divisors works well for small numbers under 50, and prime factorization is helpful when simplifying algebraic terms on paper. For large integers or long number lists, the Euclidean algorithm (gcd(a, b) = gcd(b, a mod b)) is much faster because it needs only a few modulo divisions instead of trial factoring.

What happens if one of the numbers is 0 or negative?

Negative integers are converted to their positive absolute values because -a and +a share the exact same positive divisors. If your list includes 0 alongside nonzero numbers, the calculator evaluates gcd(a, 0) = |a|. At least one number in your input list must be nonzero.

Why is the GCF of two numbers equal to 1?

A GCF of 1 means the integers share no prime factors, such as 14 (2 x 7) and 25 (5^2), or any pair of distinct prime numbers. Integers with a greatest common factor of 1 are called coprime or relatively prime, and a fraction formed by them is already in lowest terms.

How do I find the GCF of algebraic terms with variables?

First enter the numeric coefficients into this GCF calculator to find their greatest common integer divisor. Then, for each variable that appears in every term, take the smallest exponent. For 12x^3y^2 and 18x^2y^4, GCF(12, 18) is 6, the smallest power of x is x^2, and the smallest power of y is y^2, giving 6x^2y^2.

Calculate the GCF of your numbers

Return to the input box above to test another integer pair or batch list.

Calculate result