Greatest Common Factor Calculator

Find the greatest common factor (GCF) of two whole numbers.

  • Free to use
  • Accurate results
  • No registration required
  • Works on all devices
Enter two whole numbers to find their greatest common factor.

Your result

6

Greatest common factor

Least common multiple36

AI explanation

Formula

Found via the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is 0

Worked example

GCF of 12 and 18

Worked example: GCF of 12 and 18
FieldValue
First number12
Second number18
Greatest common factor6
Least common multiple36

Assumptions

  • Inputs are capped at 1,000,000 so the LCM result stays well within safe integer precision.

Frequently asked questions

What is the greatest common factor?

The largest number that divides both input numbers evenly — also called the greatest common divisor (GCD) or highest common factor (HCF).

Is this the same as the GCF Calculator?

Yes — same calculation, offered here under the full "greatest common factor" search term.

What is the Euclidean algorithm?

An efficient ancient algorithm for finding the GCF: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder reaches 0 — the last non-zero remainder is the GCF.

Related calculators

Report a calculation issue