Prime Factorization Explained: Factor Trees, Trial Division, and Why It Matters
A plain-English guide to prime factorization: the factor tree, trial division, the fundamental theorem of arithmetic, and how factors drive GCD, LCM, and fractions.
Prime Factorization Explained: Factor Trees, Trial Division, and Why It Matters
Take any whole number bigger than 1 and you can write it as a product of primes. That product is fixed. It is not one of several possible answers, it is the answer, and it never changes no matter which order you pull the factors out. That single fact, dressed up with a formal name, sits underneath fraction arithmetic, the way we find common denominators, and a surprising amount of the math people use without thinking about it. This post walks through how to actually do the factoring, why the result is unique, and where it pays off.
What a prime factorization is
A prime is a whole number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13, and on up. Everything else greater than 1 is composite, which just means it breaks apart into smaller pieces. The prime factorization of a number is the list of primes that multiply together to make it, with repeats kept.
Take 12. It splits into 4 × 3, and 4 splits into 2 × 2, so 12 = 2 × 2 × 3. We write that compactly with exponents: 12 = 2² × 3. The exponent counts how many times a prime shows up. Two things trip people up here. First, 1 is never a prime factor. It divides everything but it is a unit, not a prime, so it stays out of the list entirely. Second, the prime factors are not the same as the divisors. The prime factors of 12 are 2, 2, and 3. The divisors of 12 are 1, 2, 3, 4, 6, and 12, which includes composite numbers like 4 and 6 and the endpoints 1 and 12. Keep those two ideas separate and most of the confusion drops away.
The factor tree and trial division
There are two ways most people learn to find a factorization, and they reach the same place.
A factor tree is the visual one. Write the number, branch it into any two factors you can spot, then keep branching each composite until every leaf is prime. For 360 you might see 360 = 36 × 10, then 36 = 6 × 6 and 10 = 2 × 5, then each 6 = 2 × 3. Collect the leaves and you have your primes. The branches you pick do not matter, the leaves always end up the same, which is a nice preview of why the answer is unique.
Trial division is the systematic one, and it is what a calculator runs. The rule is simple: divide out the smallest prime repeatedly. Start with 2. While the number is even, keep pulling out 2 and dividing. When 2 no longer fits, move to 3, then 5, then 7, and so on. You only have to test divisors up to the square root of whatever is left, because if a number had a factor larger than its square root it would also have a matching factor smaller than it, which you would have found already. The mistake to avoid is stopping a prime too early: you must keep dividing by the same prime as long as it fits before moving on. Pull 2 out of 360 only once and you are left with 180, not a finished result.
A worked example: 360
Let me do 360 by hand the way the tool does it internally, dividing out the smallest prime each step:
- 360 is even, divide by 2 → 180
- 180 is even, divide by 2 → 90
- 90 is even, divide by 2 → 45
- 45 is odd, 2 no longer fits. Try 3: 45 / 3 → 15
- 15 / 3 → 5
- 5 is not divisible by 3. Try 5: 5 / 5 → 1
We hit 1, so we stop. Counting what we pulled out: three 2s, two 3s, and one 5. That gives:
360 = 2³ × 3² × 5
Check it: 8 × 9 × 5 = 360. Done.
The exponent form pays an extra dividend. You can read the divisor count straight off the exponents. Add 1 to each exponent and multiply: (3 + 1)(2 + 1)(1 + 1) = 4 × 3 × 2 = 24. So 360 has exactly 24 divisors, and you know that without listing a single one. The reason is that any divisor is built by choosing how many of each prime to include: anywhere from zero to three 2s (four choices), zero to two 3s (three choices), zero or one 5 (two choices). If you want to confirm the count or see the divisors in order, the prime factorization calculator shows the exponent form, the divisor count, and an optional full list at once.
The fundamental theorem of arithmetic
Here is the formal name for the fact I opened with: the fundamental theorem of arithmetic says that every integer greater than 1 is either prime or can be written as a product of primes in exactly one way, apart from the order of the factors. Uniqueness is the part that does the work. It is why 360 is always 2³ × 3² × 5 and never anything else. Whichever branches your factor tree takes, whichever order trial division happens to find the primes, you land on the same multiset every time.
That uniqueness is what lets you reason about numbers through their factorizations and trust the conclusion. It also explains the two edge cases cleanly. The number 1 is the empty product, a product of no primes at all, so it is neither prime nor composite. And a prime like 17 has no factorization beyond itself, written simply as 17 = 17, because there is nothing smaller to break it into.
Why it underlies GCD, LCM, and fractions
Once you have the factorizations, several common chores become mechanical instead of guesswork.
The greatest common divisor of two numbers is what they share. For each prime, take the smaller of its two exponents. Take 360 = 2³ × 3² × 5 and 420 = 2² × 3 × 5 × 7. The shared part is 2² × 3 × 5 = 60, so the GCD is 60. The least common multiple is the mirror image: for each prime, take the larger exponent. For these two that is 2³ × 3² × 5 × 7 = 2520. You can verify both relationships with a GCD and LCM calculator, but the factorization is where the logic actually lives.
Fractions fall out of the same machinery. To reduce 360/420 to lowest terms, cancel the GCD: divide both by 60 and you get 6/7, fully reduced in one move. No trial and error, no dividing by 2 then 3 then checking again, just cancel the shared 2² × 3 × 5 you can read off both factorizations side by side. Adding fractions with different denominators uses the LCM to find the smallest common denominator the same way.
I keep a soft spot for this corner of math because it was the first time, back in school, that a definition felt like it was doing something rather than just sitting there. Once I saw that reducing a fraction is exactly canceling shared primes, the whole topic stopped feeling like a bag of separate tricks and turned into one idea with several faces. Factor both numbers, compare the lists, and the answer is already in front of you.
That is the throughline. Break a number into primes once, and GCD, LCM, divisor counts, and fraction reduction are all just different ways of reading the same decomposition. The factoring is the hard part, and it is also the part you only have to do once.
Made by Toolora · Updated 2026-06-13