Every whole number greater than 1 is either a prime or can be built by multiplying primes together, and there is only one way to do it (apart from the order). That fact, the fundamental theorem of arithmetic, makes prime factorization one of the most useful tools in school mathematics. Once you know that 360 = 2³ × 3² × 5, you can simplify fractions, find common factors and multiples, count divisors and simplify square roots almost without effort.
This guide shows the two standard methods for finding a prime factorization by hand, how to write the answer in exponent form, and what you can do with it afterwards. If you first need to check whether a number is prime at all, see How to Tell if a Number Is Prime.
Primes and composites in one paragraph
A prime has exactly two divisors, 1 and itself: 2, 3, 5, 7, 11, 13, and so on. A composite number has more. The number 1 is neither, which is precisely why the factorization of every number is unique: if 1 counted as a prime, you could add as many 1s as you liked. The prime factorization of a composite number is the list of primes that multiply to give it.
Method 1: the factor tree
Split the number into any two factors, then keep splitting until every branch ends in a prime.
360
/ \
36 10
/ \ / \
6 6 2 5
/ \ / \
2 3 2 3
Collect the primes at the ends of the branches: 2, 3, 2, 3, 2, 5. Sorted and grouped, that is 2³ × 3² × 5.
The attraction of factor trees is freedom: you can start with whatever split you spot first (360 = 36 × 10, or 4 × 90, or 2 × 180) and you will always end with the same primes. The drawback is that it is easy to lose track of a branch on messy paper.
Method 2: the division ladder
Divide by the smallest prime that goes in exactly, write the quotient underneath, and repeat until you reach 1.
2 | 360
2 | 180
2 | 90
3 | 45
3 | 15
5 | 5
| 1
The primes down the left side are the factorization: 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.
The ladder is more systematic than the tree and produces the primes already in order. It is the method computers use for small numbers (called trial division), and you can stop testing a divisor once it passes the square root of what remains. If nothing up to that square root divides the number, the number itself is prime.
Divisibility shortcuts that speed up both methods
- 2: the last digit is even.
- 3: the digit sum is divisible by 3 (3 + 6 + 0 = 9).
- 5: the last digit is 0 or 5.
- 7, 11, 13: 1001 = 7 × 11 × 13, which is why numbers like 143,143 are divisible by all three.
Writing the answer in exponent form
Group repeated primes with exponents and list the primes in increasing order:
| Number | Prime factorization |
|---|---|
| 84 | 2² × 3 × 7 |
| 360 | 2³ × 3² × 5 |
| 1001 | 7 × 11 × 13 |
| 1728 | 2⁶ × 3³ |
| 65,536 | 2¹⁶ |
The exponent form is what makes the next calculations quick.
What you can do with a prime factorization
Count the divisors
Add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5¹:
(3 + 1) × (2 + 1) × (1 + 1) = 4 × 3 × 2 = 24 divisors
Why it works: any divisor of 360 uses 2 between zero and three times (four choices), 3 between zero and two times (three choices) and 5 zero or one time (two choices). For 84 = 2² × 3 × 7 there are 3 × 2 × 2 = 12 divisors: 1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84.
Add up the divisors
The sum of all divisors multiplies the sums of each prime's powers. For 360: (1 + 2 + 4 + 8) × (1 + 3 + 9) × (1 + 5) = 15 × 13 × 6 = 1,170.
Find the GCF and LCM
Line up the factorizations of 84 and 360:
- 84 = 2² × 3 × 7
- 360 = 2³ × 3² × 5
The greatest common factor takes each shared prime to the lower power: 2² × 3 = 12. The least common multiple takes every prime that appears to the higher power: 2³ × 3² × 5 × 7 = 2,520. The Euclidean algorithm is faster for the GCF of large numbers; see How to Find the GCD Fast for the comparison.
Test for perfect squares and cubes
A number is a perfect square when every exponent is even, and a perfect cube when every exponent is a multiple of 3. 3600 = 2⁴ × 3² × 5², all even, so √3600 = 2² × 3 × 5 = 60. And 1728 = 2⁶ × 3³, all multiples of 3, so its cube root is 2² × 3 = 12. The same idea simplifies roots that are not perfect: see How to Simplify Square Roots.
Using the prime factorization calculator
The Prime Factorization Calculator does the splitting for you and shows the working.
- Type a Whole number, up to 60 digits, or tap one of the example chips (360, 1001, 65536, 600851475143 and a 21-digit number).
- Read the result in exponent form, plus the expanded form, the number of divisors, the sum of divisors and the number of distinct primes.
- Open Show division ladder to see each division step, exactly as you would write it on paper.
- Below the result, the Factor tree is drawn for smaller numbers, and a list of All divisors appears when there are not too many.
If the number is prime, the tool says so and explains why (no prime up to its square root divides it). Large numbers use faster methods, Pollard's rho and the Miller–Rabin test, so something like 600,851,475,143 = 71 × 839 × 1,471 × 6,857 is instant. Occasionally a huge number has two very large prime factors that cannot be separated within the time limit; the tool then reports the part it found and flags the remainder as composite rather than guessing.
Other ways to factorize
- By hand, the ladder method is dependable for numbers up to a few thousand, especially with the divisibility tests above.
- Spreadsheets have no built-in factorization function, although
MOD(n, p) = 0tests one divisor at a time. - Programming: Python's SymPy library offers
factorint(360), which returns{2: 3, 3: 2, 5: 1}. - The GCF and LCM tools: if factorization is only a step towards a common factor or multiple, the GCF Calculator and LCM Calculator go straight to the answer.
Common mistakes
- Stopping at a composite. Every branch of a tree must end in a prime. Ending a branch at 9 or 15 leaves the factorization incomplete.
- Including 1. It is not prime and never appears in a factorization.
- Losing a factor when regrouping. Multiply the factorization back out to check it returns the original number.
- Writing 2 × 3² as 6². Exponents apply only to the prime they are attached to; 2 × 3² is 18, while 6² is 36.
Frequently asked questions
Is the prime factorization of a number unique?
Yes. Apart from the order in which you write the primes, every whole number greater than 1 has exactly one prime factorization.
What is the prime factorization of a prime number?
The number itself. For example, the prime factorization of 97 is just 97.
Does it matter which factors I start with in a factor tree?
No. Different starting splits give different-looking trees, but the primes at the ends are always the same.
How do I find how many factors a number has?
Write the prime factorization in exponent form, add 1 to each exponent and multiply the results. 360 = 2³ × 3² × 5 has 4 × 3 × 2 = 24 factors.
Why is 1 not a prime number?
Because every number could then be written with any number of extra 1s, and factorizations would no longer be unique. Primes are defined as having exactly two divisors, and 1 has only one.