Prime Factorization Calculator

Break a number down into its prime factors.

Prime factorization
Prime factors
Number of divisors
Is it prime?

Results update as you type.

About this calculator

Prime factorization expresses a whole number as a product of prime numbers — the unique "building blocks" that multiply to give it. This calculator returns the factorization in exponent form, the full list of prime factors, how many divisors the number has, and whether it is prime.

It works by trial division: divide out the smallest prime that fits (2s first, then 3s, then 5s, and so on) until only 1 remains, then group repeated primes into powers. For example, 360 = 2 × 2 × 2 × 3 × 3 × 5, written 2³ × 3² × 5. The number of divisors follows from the exponents — add one to each and multiply: (3+1) × (2+1) × (1+1) = 24 divisors for 360. If a number factors into just itself, it is prime.

Prime factorization is the basis for finding the GCD and LCM, reducing fractions, and public-key cryptography, whose security rests on how hard factoring very large numbers is. Every whole number above 1 has exactly one prime factorization.

Frequently asked questions

What is prime factorization?

It is writing a number as a product of primes. 360 = 2 × 2 × 2 × 3 × 3 × 5, usually written 2³ × 3² × 5.

How can I tell if a number is prime?

A prime has exactly one prime factor — itself. If the factorization is just the number on its own, it is prime.

How many divisors does a number have?

Add one to each exponent in the factorization and multiply. 360 = 2³ × 3² × 5, so it has (3+1) × (2+1) × (1+1) = 24 divisors.

Which prime is factored out first?

The smallest one that fits: the tool divides out all the 2s, then the 3s, then the 5s, and continues upward through the primes.

Is 1 a prime number?

No. One has no prime factors, and by convention it is neither prime nor composite, so the tool needs an input of at least 2.

What are repeated primes shown as?

They are grouped into exponent form. Three factors of 2 are written 2³ rather than 2 × 2 × 2.

❤️ Love Calculator.Free? Share it

𝕏  X Facebook Reddit
API — use this calculator from code

Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →

Endpoint

GET https://calculator.free/api/v1/prime-factorization/

curl

curl "https://calculator.free/api/v1/prime-factorization/?n=360"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/prime-factorization/?" + new URLSearchParams({
    "n": "360"
  }));
const data = await r.json();
console.log(data.results);

Results are estimates for general guidance only, not financial, medical or tax advice.