What is prime factorization?
Prime factorization (also called integer factorization or prime decomposition) breaks a positive integer down into the prime numbers that multiply together to make it. By the Fundamental Theorem of Arithmetic, every integer greater than 1 has exactly one such factorization, ignoring order. This calculator finds those primes for any whole number from 2 up to just under 10 trillion (13 digits) and presents them four ways: as a product, in exponential form, as a CSV list, and as an optional factor tree.
How to use it
Type a positive integer greater than 1 into the box and submit. Tick "create a factorization tree" if you want a visual breakdown. The result shows the prime factors written out (e.g. 2 x 2 x 5 x 5), the compact exponential form (2^2 x 5^2), a comma-separated list, the count of distinct primes, the total number of prime factors counted with multiplicity, and the prime index Prime[n] for any factor among the first 5000 primes.
The formula and algorithm
The tool uses trial division. It first removes all factors of 2, then tests odd divisors 3, 5, 7, ... while the divisor squared is no larger than the remaining value. Each time a divisor divides evenly it is recorded and divided out. Whatever is left greater than 1 at the end is itself a prime factor. Testing only up to the square root works because any composite number must have a factor at or below its square root.
$$\text{Number} = p_1^{e_1} \times p_2^{e_2} \times \cdots \times p_k^{e_k}$$
Worked example: n = 100
\(100 / 2 = 50\), \(50 / 2 = 25\), so two 2s. Then 25 is not divisible by 3 but is divisible by 5: \(25 / 5 = 5\), \(5 / 5 = 1\), giving two 5s. The factors are 2, 2, 5, 5. As a product that is 2 x 2 x 5 x 5, in exponential form 2^2 x 5^2. There are 2 distinct primes and 4 total prime factors. Check: $$2 \times 2 \times 5 \times 5 = 100$$ Prime indices: \(2 = \text{Prime}[1]\), \(5 = \text{Prime}[3]\).
FAQ
What about the number 1? The number 1 is neither prime nor composite and has no prime factors, so the calculator reports that special case.
What if my number is prime? A prime number such as 13 has itself as its only prime factor; the exponential form is just 13.
How big a number can I factor? Up to nearly 10 trillion. Numbers near that limit with a large prime factor may take a moment, since trial division checks divisors up to the square root.