Prime Factorization Calculator
Break a whole number into its prime factors, in exponent and expanded form, with the division steps.
3 distinct primes · expanded form 2 × 2 × 2 × 3 × 3 × 5.
The prime factorization of a number is the unique set of prime numbers that multiply to give it. For example, 360 = 2³ × 3² × 5 — that is 2 × 2 × 2 × 3 × 3 × 5. Every whole number greater than 1 has exactly one such factorization, a fact known as the fundamental theorem of arithmetic.
What prime factorization means
A prime is a whole number above 1 whose only divisors are 1 and itself (2, 3, 5, 7, 11, …). To factorize an integer n is to write it as a product of primes. A composite number splits into two or more prime factors, while a prime number factors only as 1 × itself. The result is usually written in exponent form, where repeated primes are grouped as powers — 2 × 2 × 2 × 3 × 3 × 5 becomes 2³ × 3² × 5.
The trial-division method
The calculator uses trial division. Start with the smallest prime, 2, and divide n by it as many times as it goes evenly; each division records one factor. Move to the next prime (3, then the odd numbers 5, 7, 9, …) and repeat. You only need to test divisors up to √n: if nothing up to that bound divides the remaining number, whatever is left is itself prime. Reading the divisors down the ladder gives the full factorization.
- 1 Start with the smallest prime. Divide n by 2 repeatedly while it stays even. For 360: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45. That is three 2s.
- 2 Move to the next prime. 45 is odd, so try 3: 45 ÷ 3 = 15, 15 ÷ 3 = 5. That is two 3s.
- 3 Continue up the primes. Try 5: 5 ÷ 5 = 1. That is one 5. Only test primes up to √n; once the quotient reaches 1 you are done.
- 4 Collect and group the factors. The divisors used were 2, 2, 2, 3, 3, 5, so 360 = 2 × 2 × 2 × 3 × 3 × 5. Grouping repeats as powers gives the exponent form 2³ × 3² × 5.
Prime factorizations of some common numbers
A prime factors only as 1 × itself; 97 is prime, so its factorization is just 97.
| Number | Prime factorization |
|---|---|
| 12 | 2² × 3 |
| 100 | 2² × 5² |
| 360 | 2³ × 3² × 5 |
| 97 | 97 (prime) |
| 1024 | 2¹⁰ |
| 1000 | 2³ × 5³ |
Why it is unique — and why it matters
The fundamental theorem of arithmetic guarantees that every integer greater than 1 is either prime or can be written as a product of primes in exactly one way, apart from the order of the factors. There is no second, different set of primes that multiplies to 360. This uniqueness is why 1 is excluded from the primes: allowing it would let you insert 1 × 1 × … endlessly and break the “exactly one” guarantee.
Prime factorization is the backbone of much of number theory. It gives a direct route to the greatest common divisor and least common multiple of two numbers — take the shared primes for the GCD, and the highest power of each prime for the LCM. It also underlies fraction simplification and, in the form of very large factors, the difficulty behind modern public-key cryptography.