Prime Factorization Calculator

Break an integer into its prime factors.

Inputs

Loading calculator…
Calculating…
Was this helpful?

Formula

Repeatedly divide n by the smallest prime ≥ 2 until n = 1

Trial division finds the prime building blocks of a composite number. Each factor is prime; multiplying them back (with exponents for repeats) reconstructs the original integer.

Worked example

360 = 2³ × 3² × 5 — three factors of 2, two of 3, and one 5. As a expanded list: 2 × 2 × 2 × 3 × 3 × 5.

Where this can give the wrong answer

  • Inputs below 2 are rejected — 1 has no prime factorization in the usual sense.
  • Very large integers (above 10¹²) are blocked to keep trial division responsive in the browser.
  • Prime inputs return themselves — factorizing 97 gives just 97.

FAQ

Prime factorizations expose shared primes for LCM (take the highest exponent of each prime) and GCD (take the lowest). This calculator lists factors; the GCD and LCM tools compute those combinations directly.

Related calculators