Prime Factorization Calculator
Enter a positive integer to get its prime factorization, plus a full list of all factors, and key properties like number of divisors and sum of divisors, with steps and a simple visual.
Background
If a positive integer n can be written as a product of two integers, those integers are called its factors. Every integer greater than 1 can be written uniquely as a product of prime numbers, called its prime factorization. From the prime factorization we can quickly find how many divisors a number has and their sum.
How this calculator works
- We take your integer n and perform trial division by primes (2, 3, 5, 7, ...) up to √n.
- Each time a prime divides n, we record the prime and increase its exponent in the prime factorization.
- Once the remaining n is 1 (or itself prime), we are done. The result has the form n = p₁e₁ p₂e₂ ....
- From the exponents we compute the number of divisors, sum of divisors, and generate the full factor list.
Formulas and definitions
If n = p₁e₁ p₂e₂ ... pkek is the prime factorization of n, then:
Number of positive divisors: d(n) = (e₁ + 1)(e₂ + 1)...(ek + 1).
Sum of positive divisors: σ(n) = (1 + p₁ + p₁² + ... + p₁e₁) (1 + p₂ + p₂² + ... + p₂e₂) ...
A number with exactly two positive divisors (1 and itself) is called prime. All other integers greater than 1 are called composite.
Example problems and step by step solutions
Example 1 — Factor 60
Start with 60.
60 ÷ 2 = 30, so we record one factor 2.
30 ÷ 2 = 15, so we have 2² and the remaining number 15.
15 ÷ 3 = 5, so we record a 3.
5 is prime.
So 60 = 2² · 3 · 5.
Number of divisors:
(2 + 1)(1 + 1)(1 + 1) = 3 · 2 · 2 = 12.
Example 2 — Factor 1024
1024 is divisible by 2 many times:
1024 ÷ 2 = 512
512 ÷ 2 = 256
256 ÷ 2 = 128
128 ÷ 2 = 64
64 ÷ 2 = 32
32 ÷ 2 = 16
16 ÷ 2 = 8
8 ÷ 2 = 4
4 ÷ 2 = 2
2 ÷ 2 = 1
We divided by 2 a total of 10 times, so
1024 = 2¹⁰.
Number of divisors:
d(1024) = 10 + 1 = 11.
Frequently asked questions
Q: What is the difference between factors and prime factors?
Factors are all the positive integers that divide a number without remainder. Prime factors are the prime numbers whose product equals the original number. Every factor can be built from the prime factors.
Q: How big a number can this calculator factor?
This tool is designed for integers up to about 1012. Larger numbers may still work but can be much slower to factor using simple methods.
Q: Why is prime factorization important?
Prime factorization is used to compute greatest common divisors, least common multiples, simplify fractions, study divisibility, and explore many number theory ideas in algebra and beyond.