CalcPro

Prime Factorization Calculator

Break a number into its prime factors.

How it works

Prime factorization breaks a number into the prime numbers that multiply together to make it. The calculator uses trial division: it tests each prime (2, 3, 5, 7, 11, …) to see if it divides the number evenly, records how many times it divides, and repeats with the quotient until nothing remains but 1.

For small to moderately large numbers, this method is fast and straightforward. The result shows both the prime factors and their exponents (how many times each prime appears).

The formula

n = p₁^a₁ × p₂^a₂ × p₃^a₃ × … × pₖ^aₖ

where p₁, p₂, p₃pₖ are distinct prime numbers and a₁, a₂, a₃aₖ are their exponents (powers).

Worked example

Let's factorize 360.

Step 1: Is 360 divisible by 2?
Yes. 360 ÷ 2 = 180. Record one factor of 2.

Step 2: Is 180 divisible by 2?
Yes. 180 ÷ 2 = 90. Record another factor of 2.

Step 3: Is 90 divisible by 2?
Yes. 90 ÷ 2 = 45. Record another factor of 2.

Step 4: Is 45 divisible by 2?
No. Move to the next prime, 3.

Step 5: Is 45 divisible by 3?
Yes. 45 ÷ 3 = 15. Record one factor of 3.

Step 6: Is 15 divisible by 3?
Yes. 15 ÷ 3 = 5. Record another factor of 3.

Step 7: Is 5 divisible by 3?
No. Move to 5.

Step 8: Is 5 divisible by 5?
Yes. 5 ÷ 5 = 1. Record one factor of 5.

Result: 360 = 2³ × 3² × 5

Or written as a list: 2, 2, 2, 3, 3, 5

You can verify: 8 × 9 × 5 = 360. ✓

Common mistakes

Forgetting to repeat: Many people divide by a prime once and move on. Always keep dividing by the same prime until it no longer divides evenly.

Including 1 in the answer: Since 1 is not prime, it should never appear in a prime factorization. If your result includes 1, you've made an error.

Stopping early: If your final quotient is greater than 1 and isn't prime, keep factoring. For instance, if you get down to 6, that's not prime—it factors as 2 × 3.

Confusing prime and composite: A prime has exactly two divisors (1 and itself). A composite has more. The number 1 is neither, and 2 is the only even prime.

Frequently asked questions

What is prime factorization?

Prime factorization is the process of expressing a number as a product of prime numbers. For example, 12 = 2 × 2 × 3. Every integer greater than 1 has a unique prime factorization.

What's the difference between factors and prime factors?

Factors are any numbers that divide evenly into your number (e.g., 1, 2, 3, 4, 6, 12 are factors of 12). Prime factors are only the prime numbers in that list (2 and 3 for 12).

Can 1 be a prime factor?

No. By definition, prime numbers are natural numbers greater than 1 that have exactly two divisors: 1 and themselves. So 1 is neither prime nor composite.

What's a factor tree?

A factor tree is a diagram showing how a number breaks down into prime factors. You split each composite number into two factors, then repeat until only primes remain at the bottom.

Why is prime factorization useful?

It helps find GCD (greatest common divisor) and LCM (least common multiple), simplify fractions, understand number properties, and solve problems in cryptography and computer science.

Can I factorize negative numbers?

Prime factorization typically applies to positive integers only. Negative numbers can be expressed as –1 times their positive factorization, but –1 itself isn't considered prime.