GCF Calculator

Enter two whole numbers to find their greatest common factor, with each step of the Euclidean algorithm shown.

Advertisement

How to use this calculator

Type two whole numbers and press Calculate. The calculator runs the Euclidean algorithm, repeated division with remainders, and shows every step down to the greatest common factor.

How it works

The Euclidean algorithm finds the GCF without listing all factors: divide the larger number by the smaller, then replace the pair with (divisor, remainder) and repeat. When the remainder hits zero, the last divisor is the GCF. It is fast even for very large numbers.

GCF(a, b) = GCF(b, a mod b), until remainder 0

Worked example

Example: GCF(48, 180)

Step 1: 180 ÷ 48 = 3 remainder 36.

Step 2: 48 ÷ 36 = 1 remainder 12.

Step 3: 36 ÷ 12 = 3 remainder 0.

Answer: the last non-zero remainder is 12, so GCF(48, 180) = 12.

Common mistakes

  • Stopping one step early: the GCF is the divisor in the step where the remainder becomes zero, the last non-zero remainder, not the final zero.
  • Confusing GCF with LCM: the GCF is the largest number dividing both (≤ the smaller input); the LCM is the smallest number both divide into (≥ the larger input).
  • GCF(0, 0): undefined, every number divides 0, so there is no “greatest” one. The calculator flags this instead of guessing.

When to use it

The GCF simplifies fractions and ratios, tiles rectangles into the largest equal squares, schedules repeating events (“every 12 and every 18 days” → every 36), and factors polynomials. Anywhere you need the biggest shared building block of two numbers, start here.

Frequently asked questions

The GCF of two numbers is the largest whole number that divides both of them evenly. For 48 and 180 it is 12, because 12 is the biggest number that goes into both.

It repeatedly replaces the larger number with the remainder of dividing it by the smaller one. The remainders shrink every step, and the last non-zero remainder is the GCF, no factor listing needed.

GCF(0, n) = n, because every number divides 0 and n is the largest divisor of itself. GCF(0, 0) is undefined.

The GCF is the largest number that divides both inputs; the LCM is the smallest number both inputs divide into. They are linked: GCF(a,b) × LCM(a,b) = a × b.