Skip to content

Prime Factorization Calculator

This prime factorization calculator writes a whole number as a product of primes, such as 360 = 2³ × 3² × 5. Enter any number up to 1 trillion. It divides by the smallest prime that fits until only 1 is left, counts the divisors from the exponents and tells you when the number is itself prime.

Last updated November 6, 2026 · Topic: Number Theory

What is prime factorization?

A prime number is a whole number greater than 1 with no divisors other than 1 and itself. Any other whole number above 1 is composite and can be broken into primes. This breakdown is its prime factorization.

The calculator gives the repeated division steps, the factorization with exponents and the number of divisors.

How prime factorization works

n=p1a1×p2a2×⋯×pkak,number of divisors=(a1+1)(a2+1)⋯(ak+1)n = p_1^{a_1} \times p_2^{a_2} \times \cdots \times p_k^{a_k}, \qquad \text{number of divisors} = (a_1 + 1)(a_2 + 1)\cdots(a_k + 1)

How to use the prime factorization calculator

  1. Type a whole number, from 1 up to a trillion.
  2. Read the factorization in the answer.
  3. Read the repeated division steps.
  4. Read the divisor count.
  5. Use the primes to find the GCF or LCM with other numbers.

Prime factorization examples

Example 1: A composite number

Factor 360. 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1. The primes used are 2, 2, 2, 3, 3 and 5, so 360 = 2³ × 3² × 5. It has 4 × 3 × 2 = 24 divisors.

Example 2: A prime number

Factor 97. Test the primes up to its square root, about 9.8: 2, 3, 5 and 7 do not divide it. So 97 is prime, and the tool says so. A prime has just two divisors, 1 and 97.

Example 3: A number with three large primes

Factor 1,001. 1,001 ÷ 7 = 143, 143 ÷ 11 = 13, and 13 is prime. So 1,001 = 7 × 11 × 13. The number has (1 + 1)(1 + 1)(1 + 1) = 8 divisors.

Example 4: A square

Factor 144. 144 = 2⁴ × 3². The divisor count is (4 + 1)(2 + 1) = 15, which is odd, so 144 is a perfect square. Indeed 144 = 12².

Factors vs prime factors

The factors of 12 are every number that divides it: 1, 2, 3, 4, 6 and 12. The prime factors are only the primes in that list, 2 and 3, and the prime factorization shows how many times each is used: 12 = 2² × 3. To see every factor and the factor pairs, use the factor calculator.

Is 0 or 1 prime?

Neither. A prime has exactly two factors, 1 and itself. The number 1 has only one factor, and 0 is divisible by every number, so it has infinitely many. Numbers above 1 that are not prime are called composite. Every composite number has exactly one prime factorization, apart from the order of the primes.

What you can do with a prime factorization

  • GCF. Multiply the primes two numbers share, at the lower power. The GCF calculator does this for up to 10 numbers.
  • LCM. Multiply every prime that appears, at the higher power, as in the LCM calculator.
  • Simplify square roots. √72 = √(2³ × 3²) = 6√2.
  • Count divisors. Add 1 to each exponent and multiply: 360 has 4 × 3 × 2 = 24 divisors.

Tips

  • Test your answer by multiplying the primes back together.
  • The exponent shows how many times a prime repeats.
  • Use the divisibility rules for 2, 3 and 5 to guess the first steps by hand.
  • To list every factor and factor pair, use the factor calculator.
  • For two or more numbers, use the GCF calculator or the LCM calculator.

Common mistakes

  • Stopping early. Make sure every number on your list is prime.
  • Treating 1 as a prime.
  • Forgetting repeated primes. 72 is 2³ × 3², not 2 × 3 × 3.
  • Mixing up factors and prime factors.

Real-life uses

Prime factorization is used to simplify fractions, find the GCF and LCM, count divisors and understand encryption. Online security relies on the fact that multiplying two large primes is quick but splitting the product back into primes is very slow. In school, it also helps with square roots and with finding perfect squares. See prime factorization made simple for the method by hand.

FAQ

Frequently asked questions

01What is a prime factor?

A prime factor is a prime number that divides a given number evenly. The prime factors of 360 are 2, 3 and 5. A prime number has only two divisors, 1 and itself. Every whole number above 1 can be written as a product of primes in exactly one way.

02Is 1 a prime number?

No. A prime has exactly two different positive divisors, but 1 has only one. This choice keeps prime factorization unique. If 1 were prime, you could write 6 as 2 × 3 or 1 × 2 × 3 and so on forever. So 1 has no prime factors.

03How does the calculator find the factors?

It divides by 2 as long as it fits, then by 3, then by each larger candidate, and it never needs to test beyond the square root of what is left. What remains at the end is itself a prime. This is called trial division and works well for numbers up to a trillion.

04How do I use the factorization to find the GCF or LCM?

For the GCF, keep the primes both numbers share, using the smaller exponent. For the LCM, keep every prime, using the larger exponent. The GCF and LCM calculators use the same factorization and show their steps, so you can compare them with this one.

05How many divisors does a number have?

Add one to each exponent in the prime factorization and multiply the results. For 360 = 2³ × 3² × 5, that is (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors. A number with an odd count of divisors is a perfect square.

06What is the largest number I can enter?

Up to one trillion, which is 1,000,000,000,000. Beyond that, trial division becomes slow in a browser. Numbers used in encryption are far larger and need special methods. For a school problem, the limit is more than enough, and it covers every number you are likely to meet.

07What is the difference between factors and prime factors?

Factors are all the whole numbers that divide a number evenly. Prime factors are only the factors that are prime. For 18, the factors are 1, 2, 3, 6, 9 and 18, but the prime factors are 2 and 3, and 18 = 2 × 3².

08Is 0 a prime number?

No. A prime number must be greater than 1 and have exactly two factors. Zero can be divided by every whole number, so it has no prime factorization. The calculator asks for numbers of 1 or more.