Skip to content
CalcSpectrum

Prime Factorization Calculator

Find the prime factorization of a positive integer, shown as a flat factor list and in exponent form (e.g. 360 = 2^3 x 3^2 x 5).

Free to use · Instant results
Loading calculator…

How It's Calculated

Formula

n = p_1^{e_1} \times p_2^{e_2} \times \cdots \times p_k^{e_k}

Prime factorization breaks a positive integer down into the unique set of prime numbers that multiply together to produce it. Every integer greater than 1 has exactly one prime factorization (up to the order the factors are listed in) — this is the Fundamental Theorem of Arithmetic. This calculator finds that factorization using trial division: it repeatedly divides the number by 2 until it no longer divides evenly, then tests each odd number from 3 upward (only up to the square root of what remains, since any remaining factor larger than that square root must itself be prime) until the number is fully broken down. The result is shown two ways: as a flat list of every prime factor with repetition (e.g. 2 x 2 x 2 x 3 x 3 x 5), and in the more compact exponent form that groups repeated primes (2^3 x 3^2 x 5). The number 1 is a special case — it has no prime factors at all, since it's neither prime nor composite, so this calculator reports that explicitly rather than treating 1 as prime or leaving the result blank.

Worked Examples

Factorize 360

  1. 360 is even: 360 / 2 = 180
  2. 180 is even: 180 / 2 = 90
  3. 90 is even: 90 / 2 = 45 (no more factors of 2)
  4. 45 / 3 = 15
  5. 15 / 3 = 5 (no more factors of 3)
  6. 5 is prime and remains as-is
  7. Prime factors: 2, 2, 2, 3, 3, 5
  8. Exponent form: 2^3 x 3^2 x 5

Factorize a prime square: 49

  1. 49 is not divisible by 2, 3, or 5
  2. 49 / 7 = 7
  3. 7 / 7 = 1 (fully factored)
  4. Prime factors: 7, 7
  5. Exponent form: 7^2

Frequently Asked Questions

Why does 1 have no prime factors?

A prime number is defined as a number greater than 1 with exactly two divisors: 1 and itself. Since 1 doesn't meet that definition, it isn't prime — and since it also can't be built by multiplying smaller primes together, it isn't composite either. It sits in its own category with no prime factorization, which is why this calculator reports it explicitly rather than treating 1 as prime.

What's the difference between the factor list and the exponent form?

The factor list shows every prime factor individually, with repeats (2 x 2 x 2 x 3 x 3 x 5 for 360). The exponent form groups repeated primes into a base and a power (2^3 x 3^2 x 5) — the same information, written more compactly. Both describe the exact same factorization.

Why are decimals and negative numbers rejected?

Prime factorization is defined for positive whole numbers only. Primes and composites are properties of integers — a decimal like 4.5 or a negative number like -12 doesn't have a prime factorization in the standard sense, so this calculator rejects those inputs rather than guessing at an answer.

Is there a limit to how large a number this calculator can factorize?

Yes — this calculator only accepts "safe" integers (up to 2^53 - 1, the largest integer JavaScript's number type can represent exactly). Beyond that limit, ordinary number arithmetic can no longer guarantee an exact result, so larger inputs are rejected rather than risking a silently wrong factorization.