Sumivo · Mathematics

GCF Calculator

Find the greatest common factor of two or more integers — the largest positive number that divides them all evenly.

01 / inputs

integers

02 / result

GREATEST COMMON FACTOR

6

GCF
6
Count
2
Coprime
No

Calculation trace

  1. gcd(12, 18) = 6
    6
    GCF step 1

Maintained by Jack Shi

§

How it works

The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest positive integer that divides every input with no remainder. The tool folds the list two at a time with the Euclidean algorithm — repeatedly replacing the pair (a, b) with (b, a mod b) until the remainder is 0 — and for three or more numbers uses gcd(a, b, c) = gcd(gcd(a, b), c).

Assumptions & limits

  • Inputs must be integers; decimals and non-numeric values are rejected.
  • A negative sign is ignored — a number and its negation share the same factors.
  • Zero is allowed because gcd(0, n) equals |n|; only an all-zero list is undefined and rejected.

Verified runs

Synthetic examples executed at build revision 24533ff on . Cards round decimal results to 6 significant figures; matching uses full precision and the tolerance below. Matches cover the displayed fields, not every possible input or clinical or engineering validation.

  • Inputs: Values: [12,18] integers

    Result: Greatest common factor: 6 integer (expected Greatest common factor: 6 integer) ✓

  • Inputs: Values: [0,5] integers

    Result: Greatest common factor: 5 integer (expected Greatest common factor: 5 integer) ✓

  • Inputs: Values: [8,12,16] integers

    Result: Greatest common factor: 4 integer (expected Greatest common factor: 4 integer) ✓

How these runs were checked

Method: gcf@1.0.0. Expectations come from the listed test fixtures or hand arithmetic; they are not copied from these executions. Omitted optional inputs use the method defaults. Run dates record execution, not expert review or fresh measurements.

Download all verified runs (JSON) — full inputs, returned values, expectations, timestamps and buildRevision.

  • normal: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Greatest common factor: 6 integer. Expected: Greatest common factor: 6 integer. Expectation: packages/calculator-core/tests/gcf.test.ts
  • boundary: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Greatest common factor: 5 integer. Expected: Greatest common factor: 5 integer. Expectation: packages/calculator-core/tests/gcf.test.ts
  • sensitivity: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Greatest common factor: 4 integer. Expected: Greatest common factor: 4 integer. Expectation: packages/calculator-core/tests/gcf.test.ts

Reproduce from the source checkout with pnpm --filter @sumivo/web gen:verified-runs. A rebuild changes execution times; the revision identifies its Git starting point, including any uncommitted changes made for that build.

§

FAQ

What is the greatest common factor?
The largest positive integer that divides each of your numbers with no remainder. For 12 and 18 the GCF is 6.
Is the GCF the same as the GCD?
Yes. Greatest common factor (GCF) and greatest common divisor (GCD) are two names for the same value; this tool computes it with the Euclidean algorithm.
What does it mean when the GCF is 1?
The numbers are coprime — they share no common factor other than 1. For example, 3 and 5 have a GCF of 1.
How are the GCF and LCM related?
For two numbers they satisfy gcf(a, b) × lcm(a, b) = |a × b|, so once you know one you can find the other.
What is the GCF used for?
Reducing fractions to lowest terms, splitting quantities into equal groups, and simplifying ratios all rely on the greatest common factor.
§

Related calculators

§

SOURCES

  • OpenStax, Rice University
    Prealgebra 2e ↗

    Greatest common factor: prime factorization and the largest shared factor

    Accessed 2026-09-02