How this instrument works
Every whole number greater than 1 breaks down into a unique product of prime numbers — its prime factorization — and that breakdown holds the greatest common factor of any two numbers in plain sight. Write out the prime factors of both numbers, note which primes appear on both lists and how many times each one repeats, then multiply just those shared primes together. What remains is the largest number dividing both originals evenly, arrived at without a single division of the original pair.
This site's plain GCD calculator reaches the identical number a different way: the Euclidean algorithm, which repeatedly divides the larger number by the smaller and keeps only the remainder, discarding the previous divisor, until that remainder hits zero. That division-and-remainder route stays quick no matter how large the two numbers get. The prime-factorization route on this page trades some of that speed for transparency — for numbers small enough to break down by eye, seeing exactly which primes are shared, and how many of each, shows WHY the answer is what it is in a way a string of remainders never does.
Two numbers that share no prime factors at all are coprime, and their factorizations make that obvious at a glance: if not one entry on either list matches an entry on the other, nothing is left to multiply together, and the greatest common factor collapses to 1. A number that is itself prime, such as 17 or 13, only ever shows up in its own breakdown and nowhere else, so pairing two different primes is the surest way to land on a shared result of exactly 1.
- Enter the first whole number into the First number field.
- Enter the second whole number into the Second number field.
- Write out the prime factors of both numbers on paper if you want to follow the method by hand.
- Read Greatest common factor: the product of every prime the two numbers share.
- Check your own shared-prime list against it — what you multiplied together should match the value shown.
Worked example — 48 and 18 by shared primes
Break 48 down: 48 = 2 × 2 × 2 × 2 × 3, or 2⁴ × 3. Break 18 down: 18 = 2 × 3 × 3, or 2 × 3². The two lists overlap on the prime 2 — 48 carries four of them, 18 carries only one, so the smaller count, one, is what gets carried forward — and on the prime 3, where 48 carries one and 18 carries two, again leaving the smaller count, one, to carry forward. Multiply the two carried values together: 2 × 3 = 6, the greatest common factor of 48 and 18.
The same method scales up cleanly. 100 breaks down as 2² × 5², and 60 breaks down as 2² × 3 × 5; the shared primes are 2² (both have at least two) and a single 5, multiplying to 4 × 5 = 20. At the other extreme, 17 and 13 are themselves prime, so each one's breakdown is just itself — nothing on either list lines up with the other, and their greatest common factor is 1.
Questions
What is the greatest common factor of two numbers?
It is the largest whole number that divides both evenly, found here by writing each number as a product of primes and multiplying together only the primes the two share. For 48 and 18 that shared product is 2 × 3 = 6, the largest whole number dividing both without a remainder.
How does the prime-factorization method actually work?
List each number's prime factors with their exponents, line the two lists up prime by prime, and for every prime appearing on both sides, keep the smaller of its two exponents. Multiplying those kept primes together produces the greatest common factor directly, with no division of the original pair required.
How is this different from this site's plain GCD calculator?
The plain GCD calculator reaches the same number through the Euclidean algorithm — repeated division of the larger number by the smaller, keeping only the remainder, until nothing is left but the answer. This page reaches an identical result through prime factorization instead, a route that stays quick for smaller numbers you can break down by eye and shows plainly which primes are actually shared.
Which method is faster for large numbers?
The Euclidean algorithm, by a wide margin. Breaking a large number down into primes gets slow fast, since no shortcut for it is known, while repeated division stays quick regardless of size. Prime factorization earns its keep on smaller pairs, where spotting the shared primes by eye is both quick and instructive.
What does it mean when two numbers share no prime factors?
It means they are coprime, and their greatest common factor is exactly 1. Two different primes, such as 17 and 13, are the clearest case: each number's breakdown is only itself, so not one entry on either list matches the other, leaving nothing to multiply together.
Can a number have more than one valid prime factorization?
No — aside from reordering the primes, every whole number greater than 1 has exactly one prime factorization, a result mathematicians call the fundamental theorem of arithmetic. That uniqueness is exactly why comparing two breakdowns always gives one unambiguous shared answer.