No ads, no sign-upChecked 2026-08-24

GCF Calculator — Greatest Common Factor

Result

6

Result: 6

The answer is the greatest common factor: the largest whole number that divides both inputs without a remainder. Euclid finds it in a handful of divisions — 12 and 18 give 6. The least common multiple follows in one line, |a × b| ÷ gcf, and stands in the table below.

The numbers at a glance

Held fixed: First number 12.

Second numberResult
012
51
102
153
18Your value6
204
251
306
351

Worked examples

How it's calculated

gcf(a, b) by Euclid; lcm = |a × b| ÷ gcf

  1. StepEnter two whole numbers. A minus sign changes nothing — the magnitude is used.
  2. StepDivide the larger by the smaller and keep the remainder.
  3. StepStart again with the smaller number and that remainder.
  4. StepThe last value before the remainder hits zero is the GCF.
  5. ResultMultiply both numbers and divide by the GCF for the LCM.

Reference table

a, bLCMGCF
0, 505
7, 13911
8, 12244
9, 999
12, 18366
-12, 18366

Questions

What is the greatest common factor?

It is the largest whole number that divides both inputs without leaving a remainder. For 12 and 18 that number is 6, because 6 is the biggest value that goes into both.

How does Euclid's algorithm find it?

Replace the larger number with the remainder of dividing it by the smaller, and repeat until the remainder is zero. The last non-zero value is the GCF: 18 mod 12 = 6, then 12 mod 6 = 0, so the answer is 6.

How are the GCF and LCM related?

They satisfy lcm(a, b) = |a × b| ÷ gcf(a, b), so once you have the GCF the LCM is one multiplication away. For 12 and 18 that is 12 × 18 ÷ 6 = 36. The table below carries the LCM for every row.

What happens with negative numbers?

Negative inputs are read as their magnitude, so −12 and 18 give the same 6 as 12 and 18. The greatest common factor is never negative.

What does the calculator do with zero?

The GCF of a number and zero is that number, because every integer divides zero. With both inputs zero the answer here is 0, which is the usual convention; the older calculator showed nothing at all.

Sources and last check

  1. en.wikipedia.org

Information, not professional advice.