Prime Factorization Calculator

Enter a whole number to write it as a product of prime numbers. You also get the number of divisors.

A whole number from 2 to 1,000,000,000,000.

This result is an estimate only. Double-check important figures before relying on them.

How it is calculated

  • Divide the number by 2 as many times as possible, then by 3, 5, 7 and the next odd numbers, up to the square root of what is left
  • Each divisor that works is a prime factor, and the number of times it divides is its exponent
  • Anything greater than 1 left over at the end is also prime
  • Number of divisors = (exponent 1 + 1) × (exponent 2 + 1) × …

To test one number, use the prime number calculator. To find common factors of several numbers, use the GCF calculator.

Worked example

360:

  • 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, so 2 divides it 3 times
  • 45 ÷ 3 = 15, ÷ 3 = 5, so 3 divides it 2 times
  • 5 is prime
  • 360 = 2³ × 3² × 5, which has 4 × 3 × 2 = 24 divisors

Why your number may differ

The calculator accepts whole numbers up to one trillion. Very large numbers with two large prime factors take longer to factor.

Frequently asked questions

What is prime factorization?

It is writing a number as a product of prime numbers. Every whole number above 1 has exactly one such product, apart from the order of the factors.

How many divisors does a number have?

Add 1 to each exponent in the prime factorization and multiply. For 360 = 2³ × 3² × 5, that is 4 × 3 × 2 = 24 divisors.

What is it used for?

Finding the GCF and LCM, simplifying fractions, and understanding the structure of a number.