Every whole number greater than 1 is built from prime factors the way a molecule is built from atoms — 18 is "made of" 2 × 3 × 3, and 24 is "made of" 2 × 2 × 2 × 3. Two numbers' greatest common factor is just the piece of that atomic structure they have genuinely in common — the largest chunk you could pull out of both molecules and still have it be a valid, smaller molecule in its own right. For 18 and 24, both share a 2 and a 3 (2 × 3 = 6) but nothing more, which is why GCF(18, 24) = 6.
Method 1: Prime Factorization
Break each number into its prime "atoms" (see How to Find the Prime Factorization of a Number if that method is unfamiliar), then look for primes appearing in both breakdowns, taking whichever power is smaller wherever a prime shows up in both — the smaller power is the most of that prime both numbers can genuinely claim to share.
Worked example: GCF of 36 and 48. 36 = 2² × 3². 48 = 2⁴ × 3. Shared primes: 2 and 3. Lower power of 2: 2² (36 has 2², 48 has 2⁴, take the smaller). Lower power of 3: 3¹ (36 has 3², 48 has 3¹, take the smaller). GCF = 2² × 3 = 4 × 3 = 12.
Method 2: the Euclidean Algorithm
Instead of breaking either number down into primes, this ancient method (attributed to Euclid, circa 300 BCE, making it one of the oldest algorithms still in everyday use) repeatedly trades the pair down to a smaller equivalent pair — divide the larger by the smaller, throw away the quotient, and replace the larger number with the remainder — until nothing's left to divide. Whatever remainder survived just before hitting zero is the answer.
Worked example: GCF of 252 and 105 using the Euclidean algorithm. 252 ÷ 105 = 2, remainder 42. Now find GCF(105, 42): 105 ÷ 42 = 2, remainder 21. Now find GCF(42, 21): 42 ÷ 21 = 2, remainder 0. The last nonzero remainder was 21, so GCF(252, 105) = 21. Checking against prime factorization: 252 = 2² × 3² × 7, 105 = 3 × 5 × 7; shared primes at lower power: 3 × 7 = 21. Matches.
Which method to use when. Prime factorization is more intuitive and shows you *why* the answer is what it is, which makes it the better teaching method and works fine for numbers you can factor by hand reasonably quickly. The Euclidean algorithm is faster for large numbers specifically because it never requires factoring them at all — for two large, hard-to-factor numbers, the Euclidean algorithm can find their GCF in a handful of division steps where prime factorization would require far more work.
GCF of more than two numbers. Find the GCF pairwise and combine: GCF(12, 18, 30) is found by first computing GCF(12, 18) = 6, then computing GCF(6, 30) = 6. The order you pair numbers in doesn't change the final answer.
A special case worth naming: coprime pairs. Two numbers that come up with a GCF of exactly 1 — nothing shared beyond the trivial factor everything has — earn the label coprime, or relatively prime, and confusingly, neither number involved actually has to be prime itself. 9 and 16 make a clean example: 9 = 3², 16 = 2⁴, and since 3 and 2 are entirely different primes, the two numbers share nothing at all, despite both being composite.
Why GCF Matters Practically
Simplifying a fraction to lowest terms is exactly dividing its numerator and denominator by their GCF — 24/36 simplifies by dividing both by GCF(24,36)=12, giving 2/3. Splitting a group of items into the largest possible number of identical smaller groups, with nothing left over, is also a GCF problem: 36 apples and 24 oranges split into the largest number of identical gift bags (each with the same apple-to-orange ratio) at GCF(36,24) = 12 bags, each holding 3 apples and 2 oranges.
Common mistakes. Mixing up GCF with its cousin LCM tops the list of errors in this topic — a fast built-in sanity check is remembering that a shared divisor can never outgrow the smaller of the two numbers it divides, so a GCF answer bigger than your smaller input is an immediate red flag that the wrong method got applied somewhere. A second common slip, specific to the prime-factorization route, is grabbing the higher exponent instead of the lower one for a shared prime — that's LCM's rule bleeding into a GCF calculation, an easy mix-up since the two methods are near-mirror images of each other apart from that single detail.
Worked example: GCF of 84 and 126 using prime factorization. 84 = 2² × 3 × 7. 126 = 2 × 3² × 7. Shared primes: 2, 3, 7. Lower powers: 2¹, 3¹, 7¹. GCF = 2 × 3 × 7 = 42.
Worked example: the same GCF using the Euclidean algorithm, to compare methods. 126 ÷ 84 = 1, remainder 42. GCF(84, 42): 84 ÷ 42 = 2, remainder 0. Last nonzero remainder: 42. Both methods agree, as they always will — this is a useful way to double-check a GCF answer if you have a spare moment, since a mismatch between the two methods signals an arithmetic error somewhere in one of them.
A geometric way to understand GCF, useful for visual learners. Imagine tiling a 18-by-24 rectangular room with the largest possible identical square tiles, with no cutting and no gaps. The largest square tile size that works is exactly GCF(18,24) = 6 — a 6×6 tile fits evenly across both the 18-unit and 24-unit sides (3 tiles across one direction, 4 across the other), and no larger square tile would divide both dimensions evenly.
GCF with one number a multiple of the other, a fast special case. If one number divides evenly into the other, the smaller number is automatically the GCF — no factorization needed. GCF(8, 24) = 8, since 8 divides evenly into 24 with nothing left over; 8 can't share a larger common factor with 24 than itself. Recognizing this pattern (does the smaller number divide evenly into the larger?) as a first quick check before doing any real work can skip the entire calculation for a meaningful fraction of real-world number pairs.
For the related calculation — the smallest number both inputs divide into, rather than the largest number that divides into both — see What Is LCM, and How Do You Find It?, and note the useful identity connecting the two: GCF × LCM = the product of the two original numbers (for exactly two numbers only).