Prime Factorization Calculator

Enter any positive integer from 2 up to 1,000,000,000,000 (10¹²) to find its complete prime factorization. The calculator shows the factorization in exponential form, a step-by-step division table, and the total number of divisors.

Integer (2 – 10¹²)

Notes

What Is Prime Factorization?

Prime factorization is the process of writing a positive integer as a product of prime numbers. By the Fundamental Theorem of Arithmetic, every integer greater than 1 has exactly one prime factorization (ignoring the order of factors).

The Factorization Formula

Where p₁ < p₂ < … < pₖ are distinct prime numbers and e₁, e₂, …, eₖ are positive integer exponents.

How to Find Prime Factors (Trial Division)

  1. Start with divisor d = 2.
  2. Divide n by d as many times as possible. Each successful division gives one prime factor.
  3. Increment d (check d = 3, 5, 7, 9, … — or skip even numbers after 2).
  4. Stop when d² > n. Any remaining n > 1 is itself a prime factor.

Number of Divisors

Once you have the prime factorization, the total number of positive divisors is:

For example, 360 = 2³ × 3² × 5, so τ(360) = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24 divisors.

If the calculator shows that a number is prime, it has exactly 2 divisors: 1 and itself.

Frequently Asked Questions

What is the prime factorization of 1?

The number 1 has no prime factorization because it has no prime factors. 1 is defined as neither prime nor composite. The Fundamental Theorem of Arithmetic applies only to integers greater than 1.

Can a prime number be factorized?

A prime number p is its own prime factorization: p = p¹. It cannot be broken down into smaller prime factors.

How does prime factorization help find GCD and LCM?

GCD: take the minimum exponent of each shared prime factor. LCM: take the maximum exponent of every prime factor present in either number. For example, GCD(12, 18) where 12 = 2² × 3 and 18 = 2 × 3² gives GCD = 2¹ × 3¹ = 6, and LCM = 2² × 3² = 36.

Why is prime factorization important in cryptography?

RSA encryption relies on the fact that multiplying two large primes is easy, but factorizing their product back into the original primes is computationally hard. This asymmetry makes it the foundation of public-key cryptography.

What is the largest number this calculator supports?

This calculator supports integers up to 1,000,000,000,000 (10¹²). Trial division up to √n = 10⁶ is fast enough to run instantly in the browser and guarantees a correct complete factorization.