Prime factorization calculator

Break a number into prime factors, list every factor, and check whether it is prime.

  • ๐Ÿ‡บ๐Ÿ‡ธ US federal & state rules

Up to 10^15. Also tells you whether the number is prime.

Example

Prime factorization of 360

2ยณ ร— 3ยฒ ร— 5

360 is composite

Number of factors
24
Sum of factors
1,170
Previous prime
359
Next prime
367

This is an example. Enter your numbers above and press the button to see your own result.

Result text

360 = 2^3 ร— 3^2 ร— 5

All 24 factors

Factors1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
Show the math
360 รท 2180
180 รท 290
90 รท 245
45 รท 315
15 รท 35
5 รท 51 (what was left is prime)
Number of factors(3+1) ร— (2+1) ร— (1+1) = 24

What to do next

How it works

The calculator divides by 2, then 3, then numbers of the form 6k ยฑ 1, and stops as soon as what is left is prime. Every whole number above 1 has exactly one prime factorization, so the result does not depend on the order you divide in.

The factor list is built from the prime powers. The sum of factors uses the formula (p^(e+1) - 1) / (p - 1) for each prime power, multiplied together.

Things to keep in mind

Numbers up to 10^15 work. A number that is the product of two large primes takes the longest, and the calculator stops after a few seconds if it can't finish.

Frequently asked questions

What is the prime factorization of 360?

360 = 2ยณ ร— 3ยฒ ร— 5. Divide by 2 three times (360, 180, 90, 45), then by 3 twice (15, 5), and 5 is prime.

How many factors does a number have?

Add 1 to each exponent and multiply. 360 = 2ยณ ร— 3ยฒ ร— 5ยน has (3+1)(2+1)(1+1) = 24 factors.

Is 1 a prime number?

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

How do I know if a big number is prime?

Enter it here. The calculator runs a Miller-Rabin test that is exact for every number in its range, then shows the previous and next prime.

Related tools