Prime Factorization Calculator

Type a whole number to break it into prime factors. You get the answer in exponent form, a factor tree, the repeated-division steps and the full list of factors.

Grades 4–8FreeNo sign-up

Try:

What is prime factorization?

A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself. The first few are 2, 3, 5, 7, 11 and 13. Every other whole number greater than 1 is composite, which means it can be built by multiplying primes together. Prime factorization is writing a number as that product of primes.

The Fundamental Theorem of Arithmetic says there is only one way to do it (apart from the order you write the primes in). So 360 is always 2 × 2 × 2 × 3 × 3 × 5, no matter how you start. That is why prime factors work like a number's fingerprint.

How to use the calculator

  1. Type a whole number from 2 up to 1,000,000,000,000 (one trillion) and press Factorize.
  2. Read the answer in exponent form, such as 360 = 2³ × 3² × 5, and in expanded form.
  3. Study the factor tree. Circled numbers are prime, so the branch stops there. Switch between a step-by-step tree and a balanced tree; both end in the same primes.
  4. Follow the repeated division table, then check the list of all factors underneath.

Method 1: repeated division

Divide by the smallest prime that goes in evenly, and keep dividing the answer until you reach 1.

Example: factorize 360.
360 ÷ 2 = 180
180 ÷ 2 = 90
90 ÷ 2 = 45 (45 is odd, so 2 no longer works)
45 ÷ 3 = 15
15 ÷ 3 = 5
5 ÷ 5 = 1
The divisors you used are the prime factors: 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.

A helpful shortcut: you only need to test primes up to the square root of the number that is left. If none of them divides it, the number left over is itself prime. For 97, the square root is about 9.8, and none of 2, 3, 5 or 7 divides 97, so 97 is prime.

Method 2: the factor tree

Write the number at the top and split it into any two factors. Keep splitting each composite branch until every branch ends in a prime. For 360 you could start with 36 × 10, then 36 = 6 × 6 and 10 = 2 × 5, then each 6 = 2 × 3. Collect the leaves: 2, 3, 2, 3, 2, 5, which is 2³ × 3² × 5 again. Different trees, same primes.

Divisibility rules that save time

PrimeA number is divisible when…
2its last digit is even (0, 2, 4, 6, 8)
3the sum of its digits is divisible by 3
5its last digit is 0 or 5
11the alternating sum of its digits is divisible by 11

Counting factors from the exponents

Once a number is in exponent form you can count its factors without listing them: add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5¹ that is (3 + 1) × (2 + 1) × (1 + 1) = 24 factors. A number is a perfect square exactly when every exponent is even.

What prime factorization is used for

Frequently asked questions

What is the prime factorization of 360?

360 = 2 × 2 × 2 × 3 × 3 × 5, which is written 2³ × 3² × 5 in exponent form.

Is 1 a prime number?

No. A prime has exactly two different factors, 1 and itself. The number 1 has only one factor, so it is neither prime nor composite, and it has no prime factorization.

How do I know when to stop dividing?

Stop when the quotient is 1. You can also stop early when the number left is smaller than the square of the prime you are testing, because then the number left must be prime.

Does it matter which factors I start a factor tree with?

No. Any pair of factors works. Every correct factor tree for a number ends with the same set of primes, only in a different order.

How do I find the number of factors from the prime factorization?

Add 1 to every exponent and multiply the results. For 72 = 2³ × 3² the count is (3 + 1) × (2 + 1) = 12 factors.

What is the largest number this calculator can factor?

It accepts whole numbers from 2 to 1,000,000,000,000 (one trillion) and factors them instantly in your browser. The full list of factors is shown when there are 200 or fewer.