Key facts
- A prime number has exactly two divisors: 1 and itself. 2, 3, 5, 7, 11 and 13 are the first six primes.
- Every whole number above 1 has exactly one prime factorization (the fundamental theorem of arithmetic).
- 360 = 2³ × 3² × 5, so it has (3 + 1)(2 + 1)(1 + 1) = 24 divisors.
- To test if n is prime, you only need to try dividing by primes up to √n.
What is prime factorization?
A prime number is a whole number greater than 1 that can only be divided evenly by 1 and itself. A composite number has other divisors too. Prime factorization breaks a composite number down into the primes that multiply to make it. The fundamental theorem of arithmetic guarantees the result is unique: apart from the order of the factors, every number has exactly one prime factorization. That makes primes the building blocks of all whole numbers.
How to use the prime factorization calculator
Enter a whole number from 2 up to 10,000,000,000,000. The calculator shows the factorization in exponent form and written out in full, whether the number is prime, how many distinct primes it has, the number of divisors, the sum of divisors and, for numbers with up to 240 divisors, every divisor.
Methods
Trial division (used by this calculator)
Divide by 2 as many times as possible, then by 3, then by each odd number in turn, stopping when the divisor squared is bigger than what remains. Whatever is left at the end, if greater than 1, is prime.
Factor tree
Split the number into any two factors, then keep splitting each branch until every leaf is prime. For 360: 360 → 36 × 10 → (6 × 6) × (2 × 5) → (2 × 3 × 2 × 3) × (2 × 5). Collect the leaves: 2³ × 3² × 5.
Divisor formulas
If n = p₁^a × p₂^b × p₃^c ..., then:
Number of divisors τ(n) = (a + 1)(b + 1)(c + 1)...Sum of divisors σ(n) = (p₁^(a+1) − 1) ÷ (p₁ − 1) × (p₂^(b+1) − 1) ÷ (p₂ − 1) × ...| Symbol | Meaning |
|---|---|
| p₁, p₂ ... | The distinct prime factors |
| a, b ... | Their exponents |
| τ(n) | How many positive divisors n has |
| σ(n) | The sum of all positive divisors of n |
Worked examples: prime factorization
Example 1: 360
360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45. Then 45 ÷ 3 = 15, ÷ 3 = 5, and 5 is prime. So 360 = 2³ × 3² × 5. It has 4 × 3 × 2 = 24 divisors, and they add up to 15 × 13 × 6 = 1,170.
Example 2: 1,001
1,001 is odd and its digit sum is 2, so 2 and 3 do not divide it. 1,001 ÷ 7 = 143, and 143 = 11 × 13. So 1,001 = 7 × 11 × 13.
Example 3: is 97 prime?
√97 ≈ 9.85, so test the primes 2, 3, 5 and 7. None divides 97, so 97 is prime.
Prime numbers under 100
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97. There are 25 of them.
Factorizations of common numbers
| Number | Prime factorization | Divisors |
|---|---|---|
| 12 | 2² × 3 | 6 |
| 24 | 2³ × 3 | 8 |
| 36 | 2² × 3² | 9 |
| 48 | 2⁴ × 3 | 10 |
| 60 | 2² × 3 × 5 | 12 |
| 72 | 2³ × 3² | 12 |
| 100 | 2² × 5² | 9 |
| 120 | 2³ × 3 × 5 | 16 |
| 144 | 2⁴ × 3² | 15 |
| 1,000 | 2³ × 5³ | 16 |
Divisibility shortcuts
| Divisor | Rule |
|---|---|
| 2 | Last digit is even |
| 3 | Digit sum is divisible by 3 |
| 5 | Last digit is 0 or 5 |
| 7 | Double the last digit and subtract it from the rest; repeat |
| 11 | Alternating digit sum is divisible by 11 |
Why primes matter
Prime factorization is how you find the LCM and GCF, simplify fractions and radicals, and count divisors. It also protects your data: RSA encryption relies on the fact that multiplying two huge primes is easy, but factoring their product back is extremely hard.
Mistakes to avoid with prime factorization
- Calling 1 a prime. It has only one divisor, so it is neither prime nor composite.
- Stopping with a composite factor. 2 × 2 × 9 is not finished, because 9 = 3².
- Forgetting that 2 is prime. It is the only even prime.
The fundamental theorem and the hardness of factoring
Every whole number above 1 can be written as a product of primes in exactly one way, apart from order: this is the fundamental theorem of arithmetic. Euclid proved the key lemma in the *Elements*, and Carl Friedrich Gauss gave the first complete proof in *Disquisitiones Arithmeticae* (1801). Prime factorizations make many questions easy: the number of divisors of 360 = 2³ × 3² × 5 is (3 + 1)(2 + 1)(1 + 1) = 24.
Multiplying primes is easy; undoing it is hard, and modern security depends on that gap. RSA encryption uses a number that is the product of two huge primes. Researchers factored RSA-250, a 250-digit (829-bit) challenge number, in February 2020 using about 2,700 CPU core-years, while typical RSA keys today are 2,048 bits or longer. A large enough quantum computer running Peter Shor’s 1994 algorithm could factor such numbers quickly, which is why the US National Institute of Standards and Technology published its first post-quantum cryptography standards in August 2024. For small numbers, trial division, as used here, is instant. To test whether a number is prime, use the prime number calculator; for the GCF and LCM from factorizations, the LCM and GCF calculator; and to simplify roots using factors, the square root calculator.
How this calculator works
- Divides by 2, then by odd numbers up to √n, recording each prime factor and its exponent.
- Shows the factorization in exponent form (such as 2³ × 3² × 5).
- From the exponents it lists all divisors, the divisor count and the sum of divisors.
- A number with no factors below its square root is reported as prime.
Frequently asked questions
What is the prime factorization of 24?
24 = 2³ × 3, or 2 × 2 × 2 × 3.
What is the prime factorization of 100?
100 = 2² × 5², or 2 × 2 × 5 × 5.
How do I find the prime factorization of a number?
Divide by the smallest prime that goes in evenly, write it down, and repeat with the result until you are left with 1. The primes you wrote down are the factorization.
Is 1 a prime number?
No. A prime must have exactly two different divisors, and 1 has only one.
How can I tell if a large number is prime?
Try dividing it by every prime up to its square root. If none divides it evenly, it is prime. This calculator does that automatically.
What is the prime factorization of 12?
12 = 2² × 3.
Why is prime factorization unique?
The fundamental theorem of arithmetic proves that every integer greater than 1 can be written as a product of primes in exactly one way, ignoring order.
How many divisors does 360 have?
360 = 2³ × 3² × 5, so it has (3 + 1)(2 + 1)(1 + 1) = 24 divisors.