Prime Factorization Calculator

Break a number into prime factors with a factor tree, and list all its factors.

A whole number of up to 30 digits.

Prime factorization of 360

2³ × 3² × 5

360 is a composite number.

Written out: 2 × 2 × 2 × 3 × 3 × 5

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

All 24 factors

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360

222333601809045155

Type a whole number to see it as a product of primes, such as 360 = 2³ × 3² × 5. The page also says whether the number is prime or composite, draws the factor tree or the division ladder, lists every factor and factor pair, and gives the primes on either side.

Understanding the result

  • Number of factors — how many whole numbers divide it exactly, 1 and the number itself included.
  • Sum of factors — all of those added up, again with the number itself.
  • Previous prime and Next prime — the nearest primes below and above.

How to use it

Number takes a whole number of up to 30 digits; commas between groups of digits are fine. A negative number is factored as its absolute value with −1 in front. 0 has no prime factorization: every whole number divides it. 1 has no prime factorization. It is neither prime nor composite.

  • Factor tree and Division ladder show the same divisions two ways, taking the smallest prime out first. The tree is drawn for up to 12 prime factors; past that only the ladder is shown. The choice is remembered on your device.
  • Factors lists every factor, and Pairs the two that multiply to the number, when there are up to 1,000 factors. Beyond that only the count is given.

Everything is worked out in your browser. Most numbers of up to 30 digits factor in well under a second. A number built from two very large primes can take longer than a browser should spend: after 10 seconds the page shows the primes found so far and names the part it could not split.

How it works

By hand, divide by the smallest prime that goes in exactly, and repeat on what is left until a prime remains. Only primes up to the square root of the remaining number need trying: if none of them divides it, it is prime. A factor tree records each split as two branches; a division ladder writes the same divisions as a column.

The exponents give the number of factors directly: add 1 to each and multiply. 360 = 2³ × 3² × 5 has 24 factors.

The tool does the same division for every prime up to 1,000,000. What is left is tested for primality with the Baillie–PSW test, and split with Pollard’s rho method if it is composite. Baillie–PSW has no proof that it is always right, but no number is known to fool it, and it has been checked for every number below 2⁶⁴.

n = p₁^a × p₂^b × … has (a + 1) × (b + 1) × … factors

Examples

Prime factorization of 360

360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, and 5 is prime. So 360 = 2³ × 3² × 5, which has 24 factors adding up to 1,170. The nearest primes are 359 and 367.

A number with no small factors: 1001

1001 is odd, its digits do not add up to a multiple of 3, and it does not end in 0 or 5, so 2, 3 and 5 are out. 7 goes in: 1001 = 7 × 11 × 13, with 8 factors: 1, 7, 11, 13, 77, 91, 143, 1,001.

A prime: 97

The square root of 97 is a little under 10, so only 2, 3, 5 and 7 need trying, and none divides it. 97 is a prime number: its only factors are 1 and itself. The next prime is 101.

Primes and factorizations to look up

The 25 primes below 100
RangePrimes
1–102, 3, 5, 7
11–2011, 13, 17, 19
21–3023, 29
31–4031, 37
41–5041, 43, 47
51–6053, 59
61–7061, 67
71–8071, 73, 79
81–9083, 89
91–10097
Prime factorization of 2 to 51
NumberPrime factorsNumberPrime factors
22273³
33282² × 7
42²2929
55302 × 3 × 5
62 × 33131
77322⁵
82³333 × 11
93²342 × 17
102 × 5355 × 7
1111362² × 3²
122² × 33737
1313382 × 19
142 × 7393 × 13
153 × 5402³ × 5
162⁴4141
1717422 × 3 × 7
182 × 3²4343
1919442² × 11
202² × 5453² × 5
213 × 7462 × 23
222 × 114747
2323482⁴ × 3
242³ × 3497²
255²502 × 5²
262 × 13513 × 17

Frequently asked questions

No. A prime has exactly two factors, 1 and itself, and 1 has only one. Leaving 1 out is also what makes a prime factorization unique: otherwise 6 could be 2 × 3, 1 × 2 × 3, 1 × 1 × 2 × 3, and so on.
Factors are all the whole numbers that divide a number; prime factors are the ones among them that are prime. 12 has the factors 1, 2, 3, 4, 6, 12, and the prime factorization 2² × 3.
No fast method is known for splitting a number into two large primes; much of today’s encryption relies on that. The time Pollard’s rho needs grows with the square root of the smallest prime factor, so a 30-digit number made of two 15-digit primes is out of reach for a web page, while one with a small factor or two falls apart at once.

See also