# What is the prime factorization?

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.

- Page: https://www.acalculator.org/math/prime-factorization-calculator
- JSON spec: https://www.acalculator.org/math/prime-factorization-calculator.json
- Version: d43c5d6aa29f

## Default answer

Example with the default inputs (Number 360): The prime factorization of 360 is 2³ × 3² × 5.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| n | Number | A whole number from 2 to 9,007,199,254,740,991 (2⁵³ − 1). |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| factorization | Prime factorization | The number as a product of prime powers, smallest prime first. |
| expanded | Written out | Every prime factor repeated, smallest first (at most 52, for 2⁵²). |
| primes | Distinct prime factors | Each prime that divides the number, once. |
| prime | Is it prime? | Yes when the number’s only prime factor is itself. |
| count | Prime factors (with repeats) | The sum of the exponents. |
| divisors | Number of divisors | The product of (exponent + 1) over the prime factors. |

## 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.

## Assumptions

- 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

1. n = 48 gives factorization = 2⁴ × 3, expanded = 2 × 2 × 2 × 2 × 3, count = 5, 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).
2. n = 84 gives factorization = 2² × 3 × 7, primes = 2, 3, 7, 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).
3. n = 360 gives factorization = 2³ × 3² × 5, expanded = 2 × 2 × 2 × 3 × 3 × 5, 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).
4. n = 9,007,199,254,740,991 gives factorization = 6,361 × 69,431 × 20,394,401, count = 3, 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).
5. n = 9,007,199,254,740,881 gives factorization = 9,007,199,254,740,881, prime = Yes, it is prime, 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).

## FAQ

### 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.

## Sources

- OpenStax, Prealgebra 2e, §2.5 Prime Factorization and the Least Common Multiple (definition; the factor tree and ladder methods; 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)
