Prime Factorization Calculator
Enter a whole number from 2 up to a trillion.
Need the full working for a harder problem? Try the factoring step-by-step solver.
The formula
Every whole number above 1 is a product of primes in exactly one way, apart from the order.
Worked example
Factor 1,001.
- It is odd, and its digits sum to 2, so it is not divisible by 2 or 3
- It does not end in 0 or 5, so not by 5
- 1,001 ÷ 7 = 143
- 143 ÷ 11 = 13, which is prime
1,001 = 7 × 11 × 13.
How it works
Divide by the smallest prime
Start with 2 and keep dividing while it goes in evenly.
Move to the next prime
Then try 3, 5, 7 and so on, dividing out each as many times as possible.
Stop at the square root
Once the prime you are trying exceeds the square root of what is left, the remainder is itself prime.
Good to know
- The number 1 is not prime, and 2 is the only even prime.
- You only need to test primes up to the square root of the number: if nothing divides it by then, it is prime.
- This calculator handles whole numbers up to one trillion.
Common questions
Is 1 a prime number?
No. A prime has exactly two different divisors, 1 and itself. The number 1 has only one.
How many divisors does a number have?
Add 1 to each exponent in the prime factorization and multiply. For 360 = 2³ × 3² × 5, that is 4 × 3 × 2 = 24 divisors.
Why does prime factorization matter?
It underlies simplifying fractions, finding GCFs and LCMs, and public-key cryptography, which relies on the fact that multiplying two large primes is easy but factoring the result is not.
How can I tell if a number is a perfect square from its factors?
Every exponent in its prime factorization is even. 144 = 2⁴ × 3² is a perfect square; 72 = 2³ × 3² is not.
What are the quick divisibility tests?
A number is divisible by 2 if it is even, by 3 if its digits sum to a multiple of 3, by 5 if it ends in 0 or 5, and by 11 if its alternating digit sum is a multiple of 11.