How this instrument works
A common factor of two whole numbers is any number that divides both of them with nothing left over; the greatest common factor, or GCF, is the largest one on that shared list. For 12 and 18 the common factors are 1, 2, 3, and 6 — four numbers dividing both cleanly — and 6 is the greatest of them, so GCF(12, 18) = 6. Every pair of positive integers has at least one common factor, because 1 always divides everything, which is why the GCF is never zero and never undefined.
The fast way to find it isn't listing every factor and intersecting the two lists — that's the mistake most people make, and it turns slow and error-prone once the numbers run into the hundreds. Euclid described a shortcut in Book VII of the Elements around 300 BCE: repeatedly replace the larger number with the remainder left after dividing it by the smaller, and stop once that remainder hits zero. For 18 and 12 that takes one step — 18 mod 12 leaves 6, and 12 mod 6 leaves 0 — so the GCF is 6, the last nonzero remainder. It is among the oldest algorithms still used exactly as first written, because it never needs to know the factors at all.
Two limits are worth knowing. The GCF can never exceed the smaller of the two numbers, since it has to divide that number evenly — so an answer larger than Number 2 signals a mistyped input, not a valid result. And when the only shared factor is 1, as with 7 and 13, the numbers are called coprime: their GCF is 1, any fraction they formed would already be in lowest terms, and no further simplification is possible.
- Enter the first whole number into Number 1.
- Enter the second whole number into Number 2 — either field can hold the larger value, since order doesn't change the answer.
- Read Greatest common factor: the largest whole number that divides both Number 1 and Number 2 with no remainder.
- To simplify a fraction, divide its numerator and its denominator by that same figure — 12⁄18 becomes 2⁄3 once both are divided by 6.
Worked example — reducing 12⁄18 to lowest terms
Enter 12 into Number 1 and 18 into Number 2. Greatest common factor returns 6 — the largest whole number dividing both exactly, since 12 = 6 × 2 and 18 = 6 × 3 with nothing left over either time.
Euclid's algorithm reaches that answer in one step: 18 mod 12 leaves a remainder of 6, then 12 mod 6 leaves a remainder of 0, so the last nonzero remainder, 6, is the GCF. Divide the fraction 12⁄18 by that figure on both sides — 12 ÷ 6 = 2 and 18 ÷ 6 = 3 — and it reduces to 2⁄3, its simplest form.
Questions
What is the difference between a common factor and the greatest common factor?
A common factor is any whole number that divides two numbers evenly — 1, 2, 3, and 6 all divide both 12 and 18. The greatest common factor is simply the largest entry on that shared list, so GCF(12, 18) = 6. Every other common factor of the pair is itself a factor of the GCF.
How is the greatest common factor different from the least common multiple?
GCF shrinks two numbers down to their largest shared divisor and is what you divide by to reduce a fraction, like turning 12⁄18 into 2⁄3. LCM builds two numbers up to their smallest shared multiple and is what you use to find a common denominator or line up repeating events. The two move in opposite directions and answer different questions.
Why does the Euclidean algorithm work for finding the GCF?
Because any number that divides both a and b also divides their difference, and therefore their remainder after division. Repeatedly replacing the larger number with that remainder shrinks the pair without ever changing what they share, until the smaller number hits zero and whatever remains is the GCF — usually in just a few steps, even for very large numbers.
What does it mean if the greatest common factor of two numbers is 1?
It means the numbers are coprime — they share no factor larger than 1. Seven and thirteen have a GCF of 1 because both are prime and different from each other. A fraction built from coprime numbers is already in its lowest terms; there is nothing left to cancel.
Can the greatest common factor ever be larger than one of the input numbers?
No. The GCF has to divide both numbers evenly, and no number greater than a can divide a without leaving a remainder — so the GCF is always less than or equal to the smaller of the two inputs. A result larger than the smaller number means one of the inputs was mistyped.
Does it matter which number goes in Number 1 and which goes in Number 2?
No — gcd(a, b) equals gcd(b, a), so the two fields are interchangeable. Enter 12 and 18 in either order and Greatest common factor still returns 6, because divisibility does not depend on which number is listed first.