Back to home

Prime Factorization Calculator

Decompose any integer into its prime factors. See the exponential form, factor tree, number of divisors, and all divisors.

Prime Factorization
Enter a positive integer ≥ 2

About Prime Factorization

The Fundamental Theorem of Arithmetic states that every integer greater than 1 can be expressed uniquely (up to ordering) as a product of prime numbers. This prime factorization is the building block of number theory. For example, 360 = 2³ × 3² × 5 tells us everything about 360's divisibility properties. Trial division — trying each prime starting from 2 up to √n — is the classic method and runs in O(√n) time.

The number of divisors (also written τ(n) or d(n)) is computed directly from the prime factorization. If n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ, then τ(n) = (e₁+1)(e₂+1)…(eₖ+1). Each factor of n corresponds to a unique choice of exponents between 0 and eᵢ for each prime pᵢ. The product of the choices gives the total count.

Prime factorization has important applications in cryptography (RSA relies on the difficulty of factorizing large numbers), simplifying fractions (divide by GCD from prime factors), computing LCM and GCD, and solving Diophantine equations. It also reveals whether a number is a perfect square (all exponents even), perfect cube (all exponents multiples of 3), and more.

Related Calculators

Explore more free online calculators to help with your calculations

Take this calculation further

Browse the math calculators collection for more tools in this subject.

For a related calculation, use LCM Calculator to calculate the Least Common Multiple of up to 10 numbers with step-by-step prime factorization. Alternatively, use Factor Calculator to find all factors, factor pairs, and prime factorization of any positive integer.