GCF Calculator

Find the greatest common factor of two numbers — with Euclid’s algorithm shown step by step, and the LCM as a bonus.

How the GCF is found

The greatest common factor (also called GCD or HCF) is the largest number dividing both inputs cleanly. Rather than listing every factor — slow and error-prone for big numbers — this calculator runs Euclid’s algorithm, the 2,300-year-old method that repeatedly replaces the larger number with the remainder of the division, and shows each step so the working can go straight onto homework.

How to use it

  1. Enter the two whole numbers.
  2. Read the GCF.
  3. Follow Euclid’s steps underneath — the last non-zero remainder is the answer.

The algorithm

gcf(a, b) = gcf(b, a mod b) — repeat until the remainder is 0

A worked example

For 48 and 36: 48 = 1×36 + 12, then 36 = 3×12 + 0 — remainder zero, so the GCF is 12. Two steps instead of listing eighteen factors. The bonus row shows the LCM, 144, via the identity a×b ÷ GCF. The everyday use is simplifying fractions: 36/48 divided top and bottom by 12 is 3/4 in one move.

Common questions

Are GCF, GCD and HCF the same thing?
Yes — greatest common factor, greatest common divisor and highest common factor are three names for one concept, varying by country and textbook.
What does a GCF of 1 mean?
The numbers are coprime — they share no factor beyond 1, like 8 and 15. Fractions built from them are already in lowest terms.
How does this help with fractions?
Divide numerator and denominator by their GCF and the fraction is fully simplified in a single step — that is the main classroom use.