Skip to content
CornerTools

Prime Factorization Calculator

Break a number into prime factors with a factor tree, list all its factors, and list the primes up to 10 million.

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

A whole number up to 10,000,000.

Number of primes
25
Largest prime
97

Prime numbers up to 100

  • 2
  • 3
  • 5
  • 7
  • 11
  • 13
  • 17
  • 19
  • 23
  • 29
  • 31
  • 37
  • 41
  • 43
  • 47
  • 53
  • 59
  • 61
  • 67
  • 71
  • 73
  • 79
  • 83
  • 89
  • 97

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. A second section lists the prime numbers up to any limit of up to 10,000,000.

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.

List the primes up to takes its own whole number, from 0 to 10,000,000, and opens on 100. It gives how many primes there are, the largest, and the primes themselves, 1,000 at a time with a button for the next 1,000. The copy button takes every prime, written without grouping and separated by commas. It is a list of primes, not a check of a number: to see whether a number is prime, enter it in Number above.

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⁶⁴.

The list of primes uses the sieve of Eratosthenes: write down the numbers, then for each prime in turn strike out its multiples, starting at its square, since a smaller multiple already has a smaller prime factor. What is never struck out is prime. Only odd numbers are written, as 2 is the one even prime. For the larger limits, up to 10,000,000, the sieve runs in a separate thread so the page stays responsive.

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
How many primes there are up to a power of ten
Up toNumber of primesLargest prime
1047
1002597
1,000168997
10,0001,2299,973
100,0009,59299,991
1,000,00078,498999,983
10,000,000664,5799,999,991
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

Type it into Number. A prime is named as one, such as “97 is a prime number: its only factors are 1 and itself.”, and a composite number shows the primes that multiply to it, which is the proof.
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