Arithmetic & Numbers

Prime Factorization Calculator

Enter a whole number to see it divided by successive primes until only 1 remains. If nothing but the number itself divides it, the calculator tells you it is prime.

A whole number from 2 to 1,000,000,000,000
Try an example:
Answer84 = 2² × 3 × 7
  • Divisors: 12
  • Sum of divisors: 224
Step-by-step working 3 steps
  1. 1
    Divide by the smallest prime that fits, again and again
    84 ÷ 2 = 42
    42 ÷ 2 = 21
    21 ÷ 3 = 7
    7 ÷ 7 = 1

    Stop when the quotient reaches 1.

  2. 2
    Collect the primes
    84 = 2 × 2 × 3 × 7
    84 = 2² × 3 × 7
  3. 3
    Count the divisors
    (3 × 2 × 2) = 12 divisors

    Add 1 to each exponent and multiply.

How to use the prime factorization calculator

  1. Enter a whole number of 2 or more.
  2. The calculator divides by the smallest prime that fits, repeatedly.
  3. Primes are collected and written with exponents.
  4. The divisor count comes from adding 1 to each exponent and multiplying.

Divisors from the factorization

n = p₁^a × p₂^b × …
Number of divisors = (a+1)(b+1)…
Sum of divisors = Π (p^(e+1) − 1)/(p − 1)

Every whole number above 1 has exactly one prime factorization (the fundamental theorem of arithmetic).

Worked examples

Each example below is generated by the same calculator you used above, so the working always matches the answer.

84
Answer84 = 2² × 3 × 7
  • Divisors: 12
  • Sum of divisors: 224
Step-by-step working 3 steps
  1. 1
    Divide by the smallest prime that fits, again and again
    84 ÷ 2 = 42
    42 ÷ 2 = 21
    21 ÷ 3 = 7
    7 ÷ 7 = 1

    Stop when the quotient reaches 1.

  2. 2
    Collect the primes
    84 = 2 × 2 × 3 × 7
    84 = 2² × 3 × 7
  3. 3
    Count the divisors
    (3 × 2 × 2) = 12 divisors

    Add 1 to each exponent and multiply.

360
Answer360 = 2³ × 3² × 5
  • Divisors: 24
  • Sum of divisors: 1170
Step-by-step working 3 steps
  1. 1
    Divide by the smallest prime that fits, again and again
    360 ÷ 2 = 180
    180 ÷ 2 = 90
    90 ÷ 2 = 45
    45 ÷ 3 = 15
    15 ÷ 3 = 5
    5 ÷ 5 = 1

    Stop when the quotient reaches 1.

  2. 2
    Collect the primes
    360 = 2 × 2 × 2 × 3 × 3 × 5
    360 = 2³ × 3² × 5
  3. 3
    Count the divisors
    (4 × 3 × 2) = 24 divisors

    Add 1 to each exponent and multiply.

97 (prime)
Answer97 is prime
  • Divisors: 2
  • Sum of divisors: 98
Step-by-step working 3 steps
  1. 1
    Divide by the smallest prime that fits, again and again
    97 ÷ 97 = 1

    Stop when the quotient reaches 1.

  2. 2
    Check

    Only 97 itself divides 97 without a remainder (besides 1), so 97 is prime.

  3. 3
    Count the divisors
    (2) = 2 divisors

    Add 1 to each exponent and multiply.

1001
Answer1001 = 7 × 11 × 13
  • Divisors: 8
  • Sum of divisors: 1344
Step-by-step working 3 steps
  1. 1
    Divide by the smallest prime that fits, again and again
    1001 ÷ 7 = 143
    143 ÷ 11 = 13
    13 ÷ 13 = 1

    Stop when the quotient reaches 1.

  2. 2
    Collect the primes
    1001 = 7 × 11 × 13
  3. 3
    Count the divisors
    (2 × 2 × 2) = 8 divisors

    Add 1 to each exponent and multiply.

Common mistakes to avoid

Treating 1 as prime

1 has only one divisor, and primes need exactly two. That is why factorization starts at 2.

Stopping at a composite factor

If a factor like 6 is left, keep going: 6 = 2 × 3. Only primes belong in the final list.

Forgetting that 2 is prime

2 is the only even prime, and it is often the first factor to check.

Frequently asked questions

How can I tell quickly whether a number is prime?

Test divisibility by primes up to its square root. If none divide it, it is prime. The calculator does exactly this.

Why is the limit one trillion?

Trial division up to the square root is instant at that size. Much larger numbers need specialist algorithms.