Every whole number greater than 1 is either prime or can be built by multiplying primes together, and there is only one way to do it. Finding those primes is called prime factorization. It is the key to simplifying fractions, finding the greatest common factor and least common multiple, and understanding how numbers are built. Our prime factorization calculator breaks a number into primes and shows a factor tree, step by step. This guide explains the method.
How to use the calculator
Enter a whole number. With the default 1,260:
- Prime factorization: 2² × 3² × 5 × 7
- Is it prime? No
- Factor tree steps: 1,260 = 2 × 630, 630 = 2 × 315, 315 = 3 × 105, 105 = 3 × 35, 35 = 5 × 7.
What is a prime number?
A prime has exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. The number 2 is the only even prime. The number 1 is not prime, because it has only one factor.
Method: trial division
Divide by the smallest prime that goes in exactly. Repeat with the result until you reach 1.
1,260:
- 1,260 is even: 1,260 ÷ 2 = 630.
- 630 is even: 630 ÷ 2 = 315.
- 315 is odd. Digit sum 3 + 1 + 5 = 9 is divisible by 3: 315 ÷ 3 = 105.
- 105: digits sum to 6, so 105 ÷ 3 = 35.
- 35 ends in 5: 35 ÷ 5 = 7.
- 7 is prime.
Collect the divisors: 2 × 2 × 3 × 3 × 5 × 7 = 2² × 3² × 5 × 7.
You only need to test primes up to the square root of what is left. If none divides it, what is left is prime.
Method: the factor tree
Split the number into any two factors, then keep splitting until every branch ends in a prime. For 1,260 you might start with 1,260 = 36 × 35, then 36 = 6 × 6 = 2 × 3 × 2 × 3 and 35 = 5 × 7. The leaves are the same primes whichever split you choose. That is the fundamental theorem of arithmetic: every number has exactly one prime factorization.
Exponent notation
Repeated primes are written with exponents to keep things short. 2 × 2 × 2 × 3 × 3 × 5 becomes 2³ × 3² × 5. The exponent calculator multiplies them back out.
Using prime factors
Greatest common factor (GCF). Take the primes the numbers share, at the lowest power. For 1,260 = 2² × 3² × 5 × 7 and 600 = 2³ × 3 × 5²: GCF = 2² × 3 × 5 = 60. See the GCF calculator.
Least common multiple (LCM). Take every prime that appears, at the highest power: 2³ × 3² × 5² × 7 = 12,600. See the LCM calculator.
Counting factors. Add 1 to each exponent and multiply: (2 + 1)(2 + 1)(1 + 1)(1 + 1) = 36 factors for 1,260. The factor calculator lists them all.
Simplifying square roots. √1,260 = √(2² × 3² × 35) = 2 × 3 × √35 = 6√35. The root calculator gives the decimal.
Simplifying fractions. Cancel shared primes from the top and bottom.
Quick divisibility tests
- 2: last digit even.
- 3: digit sum divisible by 3.
- 5: ends in 0 or 5.
- 7: double the last digit and subtract from the rest; repeat. 315 → 31 − 10 = 21, which is divisible by 7.
- 11: alternating digit sum divisible by 11. For 1,331: 1 − 3 + 3 − 1 = 0.
Why prime factorization matters
Multiplying primes together is easy, but splitting a large number back into its primes is extremely hard. Modern internet security, such as RSA encryption, relies on this: it uses numbers hundreds of digits long that are the product of two huge primes. The big number calculator lets you experiment with large products.
Frequently asked questions
Is 1 a prime number?
No. A prime must have exactly two different factors, and 1 has only one. Excluding it also keeps every number's prime factorization unique.
Can a prime factorization be done in a different order?
The order of the factors can change, but the set of primes and their powers is always the same.
How do I know when to stop dividing?
Stop when the remaining number is prime. If no prime up to its square root divides it, it is prime.
What is the prime factorization of a prime number?
Just the number itself. For example, the prime factorization of 13 is 13.
Try it yourself
Run your own numbers with our free tool: Prime factorization calculator. No sign-up, and it works on any device.