Math · 4 min read

Prime Factorization Explained (with Examples)

Prime factorization breaks a number into the prime numbers that multiply to make it. Learn the method, how to count a number's divisors, and worked examples.

Try the prime factorization calculatorPut these numbers to workOpen →

Prime factorization means writing a whole number as a product of prime numbers — numbers whose only divisors are 1 and themselves. Every integer greater than 1 has exactly one prime factorization (the fundamental theorem of arithmetic), which makes it the backbone of finding greatest common divisors, least common multiples, and simplifying fractions.

Example: 360 = 2 × 2 × 2 × 3 × 3 × 5, written compactly as 2³ × 3² × 5.

How to factor a number

  1. 1Divide by the smallest prime that goes in evenly — start with 2, then 3, 5, 7, and so on.
  2. 2Keep dividing the result by that same prime until it no longer divides evenly.
  3. 3Move to the next prime and repeat.
  4. 4Stop when the number left is 1. The primes you divided by, with their counts, are the factorization.

Worked example: 84

84 ÷ 2 = 42, ÷ 2 = 21. 21 is not even, so try 3: 21 ÷ 3 = 7. 7 is prime. So 84 = 2 × 2 × 3 × 7 = 2² × 3 × 7.

Counting the divisors

Once you have the factorization, add one to each exponent and multiply the results — that is how many divisors the number has. For 360 = 2³ × 3² × 5¹, it is (3 + 1)(2 + 1)(1 + 1) = 24 divisors. This trick saves you from listing them all by hand.

Why it is useful

  • Greatest common divisor (GCD): multiply the primes both numbers share, at the lowest power each appears.
  • Least common multiple (LCM): multiply every prime that appears in either number, at the highest power.
  • Simplifying fractions: cancel the prime factors the numerator and denominator have in common.
  • Checking if a number is prime: if it has no prime factors other than itself, it is prime.
A prime number's factorization is just the number itself — it has exactly two divisors, 1 and itself.

Related calculators