GCF Calculator

Free, with no sign up. Calculations run on your device; your entries stay in this browser.

Enter 2–20 integers separated by commas, spaces or newlines. Each integer must be between −1,000,000,000,000 and 1,000,000,000,000 (±10¹²); at most 14 characters each. These are unitless numbers. The result and every factorization use exact BigInt arithmetic, even when the LCM exceeds the safe JavaScript Number range. Negative inputs use absolute values for GCF and LCM. Zero has no prime factorization; one has no prime factors.

Your result

Enter values and select Calculate.

gcd(a, b) = gcd(b, a mod b); repeat until the remainder is zero. GCF takes the minimum shared prime exponents.

Primary source: OpenStax Prealgebra 2e, prime factorization and least common multiple.

Worked example

For 12, 18 and 24: 12 = 2² × 3, 18 = 2 × 3², 24 = 2³ × 3. The GCF is 2 × 3 = 6.

How to use this tool

Enter your measured values and select Calculate to see the result, formula and details below.

Frequently asked questions

What is the difference between GCF and LCM?

GCF is the largest nonnegative common divisor. LCM is the smallest positive common multiple of nonzero inputs.

How are zero and negative integers handled?

Signs are ignored for GCF and LCM. A zero input gives LCM zero by convention; GCF(0, n) is |n| and GCF(0, 0) is zero by convention.

Are the result and factors exact?

Yes. Decimal strings are parsed as BigInt, never floating-point Number. Every accepted integer is fully factored within the ±10¹² bound.