Skip to content
UnitFormula

To find a number's prime factorization, divide it by the smallest prime that goes in evenly, then keep dividing the result the same way until you are left with 1. Collecting the primes you divided by — grouped as powers — gives the factorization, and by the Fundamental Theorem of Arithmetic it is the only one the number has. Enter a whole number and the calculator does this for you. For example, 360 = 2³ × 3² × 5.

Prime Factorization Calculator — factor a number into primes

The prime factorization of 360.

Prime factorization2³ × 3² × 5
Distinct primes
3
Total prime factors
6

Quick examples

How it's calculated

  1. Divide out prime factors until only 1 remains360=23×32×5360 = 2^{3} \times 3^{2} \times 5
    value
    = 360
    360
Prime factorization2³ × 3² × 5

How it works

A prime is a whole number greater than 1 whose only divisors are 1 and itself (2, 3, 5, 7, 11, …). The Fundamental Theorem of Arithmetic says every whole number above 1 is either prime or can be written as a product of primes in exactly one way, apart from the order. That unique product is the number's prime factorization.

The calculator finds it by trial division: it tries the smallest prime, 2, and divides it out as many times as it goes in evenly, then moves on to 3, 5, 7 and so on, up to the square root of what remains. Anything left over at the end is itself a prime. Repeated factors are collected into powers, so 2 × 2 × 2 becomes 2³.

Alongside the factorization the calculator reports two counts: the number of distinct primes (how many different primes appear) and the total prime factors (the same primes counted with their repeats). These underpin greatest common factors, lowest common multiples and reducing fractions.

Worked example

Take 360. Divide by 2 three times (360 → 180 → 90 → 45), then by 3 twice (45 → 15 → 5), then by 5 once, leaving 1. The primes used are 2, 2, 2, 3, 3, 5, which gather into 2³ × 3² × 5. That is 3 distinct primes and 6 prime factors in total.

Frequently asked questions

How do you find the prime factorization of a number?

Divide the number by the smallest prime that divides it evenly, then repeat on the quotient until you reach 1. The primes you divided by, grouped into powers, are the factorization. For 360 this gives 2³ × 3² × 5.

What is the Fundamental Theorem of Arithmetic?

It states that every whole number greater than 1 is a product of prime numbers in exactly one way, ignoring the order of the factors. This is why a number's prime factorization is unique — there is only one correct answer.

What does 2³ × 3² × 5 mean?

The superscripts are exponents showing how many times each prime is repeated: 2³ is 2 × 2 × 2 = 8, and 3² is 3 × 3 = 9. Multiplying 8 × 9 × 5 gives 360, the original number.

Is 1 a prime number, and can it be factored?

No. By definition a prime is greater than 1, so 1 is neither prime nor composite and has no prime factorization. The smallest number with a factorization is 2, which is prime itself.

What is the difference between distinct and total prime factors?

Distinct primes counts how many *different* primes appear; total prime factors counts them *with repeats*. For 360 = 2³ × 3² × 5, there are 3 distinct primes (2, 3, 5) but 6 total prime factors (three 2s, two 3s and one 5).

How is prime factorization used?

It is the basis for finding the greatest common factor and lowest common multiple of numbers, for simplifying fractions, and in cryptography, where the difficulty of factoring very large numbers keeps encrypted data secure.

How we know this is right

Last reviewed
Aug 7, 2026
Precision
Rounded to 0 decimal places.
Read our methodology

Sources