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.
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
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
| Range | Primes |
|---|---|
| 1–10 | 2, 3, 5, 7 |
| 11–20 | 11, 13, 17, 19 |
| 21–30 | 23, 29 |
| 31–40 | 31, 37 |
| 41–50 | 41, 43, 47 |
| 51–60 | 53, 59 |
| 61–70 | 61, 67 |
| 71–80 | 71, 73, 79 |
| 81–90 | 83, 89 |
| 91–100 | 97 |
| Up to | Number of primes | Largest prime |
|---|---|---|
| 10 | 4 | 7 |
| 100 | 25 | 97 |
| 1,000 | 168 | 997 |
| 10,000 | 1,229 | 9,973 |
| 100,000 | 9,592 | 99,991 |
| 1,000,000 | 78,498 | 999,983 |
| 10,000,000 | 664,579 | 9,999,991 |
| Number | Prime factors | Number | Prime factors |
|---|---|---|---|
| 2 | 2 | 27 | 3³ |
| 3 | 3 | 28 | 2² × 7 |
| 4 | 2² | 29 | 29 |
| 5 | 5 | 30 | 2 × 3 × 5 |
| 6 | 2 × 3 | 31 | 31 |
| 7 | 7 | 32 | 2⁵ |
| 8 | 2³ | 33 | 3 × 11 |
| 9 | 3² | 34 | 2 × 17 |
| 10 | 2 × 5 | 35 | 5 × 7 |
| 11 | 11 | 36 | 2² × 3² |
| 12 | 2² × 3 | 37 | 37 |
| 13 | 13 | 38 | 2 × 19 |
| 14 | 2 × 7 | 39 | 3 × 13 |
| 15 | 3 × 5 | 40 | 2³ × 5 |
| 16 | 2⁴ | 41 | 41 |
| 17 | 17 | 42 | 2 × 3 × 7 |
| 18 | 2 × 3² | 43 | 43 |
| 19 | 19 | 44 | 2² × 11 |
| 20 | 2² × 5 | 45 | 3² × 5 |
| 21 | 3 × 7 | 46 | 2 × 23 |
| 22 | 2 × 11 | 47 | 47 |
| 23 | 23 | 48 | 2⁴ × 3 |
| 24 | 2³ × 3 | 49 | 7² |
| 25 | 5² | 50 | 2 × 5² |
| 26 | 2 × 13 | 51 | 3 × 17 |
Frequently asked questions
See also
- LCM and GCF Calculator — for the LCM and GCF of several numbers from their prime factors.
- Fraction Calculator — to reduce a fraction by the factors its two parts share.