What is the prime factorization?
Type a whole number. The prime factorization calculator writes it as a product of prime numbers, such as 360 = 2³ × 3² × 5, lists the distinct primes, says whether the number is prime, and counts its divisors.
- Prime factorization
- 2³ × 3² × 5
The prime factorization of 360 is 2³ × 3² × 5.
- Written out
- 2 × 2 × 2 × 3 × 3 × 5
- Distinct prime factors
- 2, 3, 5
- Is it prime?
- No, it is composite
- Prime factors (with repeats)
- 6
- Number of divisors
- 24
Prime factorization: 2³ × 3² × 5. The prime factorization of 360 is 2³ × 3² × 5.
How to calculate
Writes a whole number from 2 to 9,007,199,254,740,991 as a product of primes, in exponent form and written out, with its distinct prime factors and number of divisors.
Example with the default inputs (Number 360): The prime factorization of 360 is 2³ × 3² × 5.
Method: Divide by primes up to 1,000; test what is left with Miller–Rabin and split it with Pollard’s rho until every factor is prime.
- The number is a whole number from 2 to 9,007,199,254,740,991 (2⁵³ − 1), the largest whole number a double holds exactly.
- 1 is not prime and has no prime factorization; every whole number from 2 up has exactly one.
Worked examples
Each example is checked against the calculator on every build.
- Number 48 gives Prime factorization 2⁴ × 3, Written out 2 × 2 × 2 × 2 × 3, Prime factors (with repeats) 5, Number of divisors 10.Source: OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (the prime factorization of a number is the product of prime numbers that equals the number; 48 = 2⁴ × 3, 84 = 2² × 3 × 7, 120 = 2³ × 3 × 5), https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple (retrieved 2026-10-02)
- Number 84 gives Prime factorization 2² × 3 × 7, Distinct prime factors 2, 3, 7, Number of divisors 12.Source: OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (the prime factorization of a number is the product of prime numbers that equals the number; 48 = 2⁴ × 3, 84 = 2² × 3 × 7, 120 = 2³ × 3 × 5), https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple (retrieved 2026-10-02)
- Number 360 gives Prime factorization 2³ × 3² × 5, Written out 2 × 2 × 2 × 3 × 3 × 5, Number of divisors 24.Source: OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (the prime factorization of a number is the product of prime numbers that equals the number; 48 = 2⁴ × 3, 84 = 2² × 3 × 7, 120 = 2³ × 3 × 5), https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple (retrieved 2026-10-02)
- Number 9,007,199,254,740,991 gives Prime factorization 6,361 × 69,431 × 20,394,401, Prime factors (with repeats) 3, Number of divisors 8.Source: OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (the prime factorization of a number is the product of prime numbers that equals the number; 48 = 2⁴ × 3, 84 = 2² × 3 × 7, 120 = 2³ × 3 × 5), https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple (retrieved 2026-10-02)
- Number 9,007,199,254,740,881 gives Prime factorization 9,007,199,254,740,881, Is it prime? Yes, it is prime, Number of divisors 2.Source: OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (the prime factorization of a number is the product of prime numbers that equals the number; 48 = 2⁴ × 3, 84 = 2² × 3 × 7, 120 = 2³ × 3 × 5), https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple (retrieved 2026-10-02)
How it works
For a whole number n from 2 to 9,007,199,254,740,991:
- Divide n by 2, then by each odd number up to 999, as often as each goes in evenly. (Only primes can go in, because their smaller factors were already removed.)
- If what is left, m, is above 1, test it with the Miller–Rabin test using the 12 prime bases 2 to 37, which decides every number below 3.3 × 10²⁴ without error.
- If m is not prime, split it with Pollard’s rho method (x → x² + c mod m) and repeat steps 2 and 3 on both parts.
The result is the same as dividing by every prime up to √n; the last two steps are only faster. All arithmetic is exact (BigInt).
- Prime factorization: the primes in increasing order, each with its exponent as a superscript, left out when it is 1: 2³ × 3² × 5.
- Written out: each prime repeated as often as its exponent (at most 52 factors, for 2⁵²).
- Number of divisors = the product of (exponent + 1).
- Is it prime? “Yes, it is prime” when n has one prime factor with exponent 1, otherwise “No, it is composite”.
Rules
- n is a whole number from 2 to 2⁵³ − 1; anything else (0, 1, negatives, decimals, larger numbers) is refused.
Output format. Primes with thousands separators (20,394,401), joined by “ × ”; the distinct primes joined by “, ”.
Worked examples by hand
48. 48 ÷ 2 = 24, ÷ 2 = 12, ÷ 2 = 6, ÷ 2 = 3: 2⁴ × 3, (4 + 1)(1 + 1) = 10 divisors.
84. 84 ÷ 2 = 42, ÷ 2 = 21, ÷ 3 = 7: 2² × 3 × 7, 3 × 2 × 2 = 12 divisors.
360. 360 = 2 × 180 = 2 × 2 × 90 = 2 × 2 × 2 × 45 = 2³ × 45, and 45 = 3² × 5: 2³ × 3² × 5, 4 × 3 × 2 = 24 divisors.
2⁵³ − 1 = 9,007,199,254,740,991. 6,361 × 69,431 = 441,650,591, and 441,650,591 × 20,394,401 = 9,007,199,254,740,991, with each of the three factors prime: 6,361 × 69,431 × 20,394,401, 2 × 2 × 2 = 8 divisors.
Other questions people ask
What is prime factorization?
Writing a number as a product of prime numbers. OpenStax’s definition: the product of prime numbers that equals the number. 48 = 2 × 2 × 2 × 2 × 3, or 2⁴ × 3 with exponents.
How do I find the prime factorization of a number?
Divide by the smallest prime that goes in evenly, and repeat on the quotient until it is 1 (the ladder method), or split the number into any two factors and keep splitting (a factor tree). For 84: 84 ÷ 2 = 42, ÷ 2 = 21, ÷ 3 = 7, so 84 = 2² × 3 × 7.
Is the prime factorization of a number unique?
Yes. Every whole number greater than 1 has exactly one prime factorization, apart from the order of the factors. This is the fundamental theorem of arithmetic, which is why a factor tree always ends with the same primes.
Does 1 have a prime factorization?
No. 1 is neither prime nor composite, and it is the empty product, so the calculator starts at 2. A prime number’s factorization is the number itself, such as 97 = 97.
How do I count the divisors from the prime factorization?
Add 1 to each exponent and multiply. 360 = 2³ × 3² × 5¹ has (3 + 1)(2 + 1)(1 + 1) = 24 divisors, counting 1 and 360.
How large a number can it factor?
Up to 9,007,199,254,740,991 (2⁵³ − 1), the largest whole number a JavaScript number holds exactly. That number is 6,361 × 69,431 × 20,394,401. Larger numbers would lose digits before they could be factored.