Calculateus

Prime Factorization Calculator

Break a number down into its prime factors.

Result

Prime Factorization
2^3 × 3^2 × 5
Number of Prime Factors
6

About the Prime Factorization Calculator

Every whole number greater than 1 breaks down into a unique product of prime numbers, a fact known as the fundamental theorem of arithmetic. Our Prime Factorization Calculator finds that breakdown for any number you enter, showing each prime factor and how many times it appears.

How It Works

You enter a whole number of 2 or greater. The calculator repeatedly divides out the smallest possible prime factor until nothing but prime factors remain, then groups repeated primes using exponent notation.

n = p₁^e₁ × p₂^e₂ × ... × pₖ^eₖ, where each pᵢ is prime

Formula & Methodology

The calculator uses trial division: starting at the smallest prime, 2, it repeatedly checks whether that number divides the remaining value evenly. If it does, it divides it out and records the factor, then tries the same divisor again, since a prime factor can appear multiple times. Once a divisor no longer divides evenly, the calculator moves to the next candidate divisor and repeats. This only needs to check divisors up to the square root of the number, because if n has no factor at or below its square root, whatever is left over must itself be prime. That's why the loop stops once the candidate divisor squared exceeds the remaining value, at which point any number still greater than 1 is added as a final prime factor.

Step-by-Step: Calculating It By Hand

  1. 1Start with a divisor of 2, the smallest prime.
  2. 2Divide the number by the divisor repeatedly, as many times as it divides evenly, recording each division.
  3. 3Move to the next integer divisor and repeat, stopping once the divisor squared exceeds the remaining value.
  4. 4If anything greater than 1 remains at the end, it is itself a prime factor.
  5. 5Group repeated factors using exponents for a compact final answer.

Examples

Composite number

360 factors into 2³ × 3² × 5, using three distinct prime factors.

Prime number

97 is already prime, so its factorization is simply 97 with no further breakdown.

Advantages

  • Instantly finds the complete prime factorization of any whole number
  • Groups repeated prime factors with clear exponent notation
  • Correctly identifies when the input itself is already prime
  • Much faster than working through trial division by hand for larger numbers

Common Mistakes

  • Forgetting that 1 has no prime factorization, since it isn't considered prime or composite
  • Stopping the factorization too early and leaving a composite factor unbroken
  • Assuming every number has a unique 'largest' prime factor without checking the full breakdown
  • Confusing prime factorization with simply listing all divisors of a number

Edge Cases to Watch For

  • If the number entered is itself prime, the factorization is just that number with no further breakdown.
  • Numbers below 2 have no prime factorization, since 1 is neither prime nor composite and primes must be 2 or greater.
  • Powers of a single prime, like 64 (2⁶), factor down to just one repeated prime.
  • Very large numbers can take longer to factor since trial division checks every candidate up to the square root.

Common Use Cases

  • Finding the greatest common factor or least common multiple of two numbers
  • Simplifying fractions and radicals in algebra
  • Cryptography concepts that rely on the difficulty of factoring large numbers
  • Number theory coursework and homework
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

How does this handle prime numbers themselves?

If the number you enter is already prime, the factorization is just that number itself with no further breakdown - the loop finds no divisors up to its square root, so the whole number is added as the sole remaining factor.

Conclusion

Prime factorization is the foundation a lot of other number theory builds on, from simplifying fractions to finding common factors. Our GCF & LCM Calculator uses this same idea to compare two numbers directly.