AllOfCal
← All calculators

Prime Factorization Calculator

Break a whole number into its prime factors.

1 input

Number

Reviewed October 7, 2026

Fundamental theorem of arithmetic; trial division.

Change any value and press Calculate to update the result.

Waiting for input

Enter your values and press Calculate.

How this calculator works

Every whole number greater than 1 is either prime or can be written as a product of primes in exactly one way, apart from the order. That is the fundamental theorem of arithmetic. The calculator finds the factors by trial division, which is fast for numbers up to a trillion, and uses the exponents to count how many divisors the number has.

Formula

  • Divide by 2, then by each odd number up to √n, as many times as it divides evenly
  • If what remains is greater than 1, it is prime
  • Number of divisors = (e₁ + 1)(e₂ + 1)… for n = p₁^e₁ × p₂^e₂ × …

Worked example

360

Number
360

Result360 = 2^3 × 3^2 × 5

3 distinct prime factors.

Frequently asked questions

Is 1 a prime number?

No. A prime has exactly two distinct divisors, 1 and itself. The number 1 has only one.

How do I know if a number is prime?

If no prime up to its square root divides it, it is prime. This calculator reports 'prime' when the factorization is the number itself.

What is prime factorization used for?

Simplifying fractions, finding greatest common divisors and least common multiples, and as the basis of public-key cryptography.

Results are estimates based on the values you enter and the published method shown above. They do not replace professional medical, financial or legal advice. Method reviewed October 7, 2026. About this site