Prime Factorization Calculator · Practical guide
How to Find Prime Factors of a Number
Trial division — divide out small primes until only primes remain — factors any number by hand.
At a glance
The Trial Division Method
- Divide out every 2 while the number is even, counting how many you pull out.
- Try odd primes in order — 3, 5, 7, 11 — dividing out each one completely before moving on.
- Stop when the prime squared exceeds what remains. Whatever is left is itself prime.
Interactive tool
Prime Factorization Calculator
Enter your own values, then compare the result with the examples below.
Result
Worked Example: 252
252 is even, so divide by 2: 252 → 126 → 63 (two 2s). Now 63 is odd but divisible by 3: 63 → 21 → 7 (two 3s). Since 7 is prime, the factorization is 2^2 × 3^2 × 7. Check: 4 × 9 × 7 = 252.
When You Can Stop Dividing
You only need to test primes up to the square root of the remaining number. For 252, the square root is about 15.9, so testing 2, 3, 5, 7, 11, and 13 is sufficient — and in practice the number shrinks as you divide, ending the search even sooner. The calculator above uses this same method, which is why it factors numbers up to 1 trillion instantly.
Quick Divisibility Checks
- 2: the number is even.
- 3: the digit sum is a multiple of 3 (252 → 2+5+2 = 9, yes).
- 5: the number ends in 0 or 5.
- Bigger primes: there is no shortcut — just divide and see.
Frequently Asked Questions
Does every number have a prime factorization?
Every integer greater than 1 does, and it is unique apart from ordering — a fact known as the fundamental theorem of arithmetic.
What about the number 1?
One is neither prime nor composite and has no prime factorization. It is the multiplicative identity, so including it would make factorizations non-unique.
Which prime should I try first?
Always start with 2, then work upward through the odd primes 3, 5, 7, 11. Smaller primes divide more numbers, so you eliminate them fastest.
How big a number can this calculator handle?
Positive integers up to 1 trillion (1,000,000,000,000). Enter the number above to get the factorization, a factor tree, and a primality check instantly.