Calcamaze

Prime Factorization Calculator

Break a whole number into its prime factors, check whether it is prime, and list all of its divisors.

Result

Prime factorization
360 = 2³ × 3² × 5
Prime?
No — it is composite
Expanded
2 × 2 × 2 × 3 × 3 × 5
Distinct prime factors
2, 3, 5
Number of divisors
24
Sum of divisors
1,170
Divisors
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
Prime factors
PrimePowerContributes
238
329
515

Enter a whole number to write it as a product of prime numbers — its prime factorization — in exponent form such as 360 = 2³ × 3² × 5. The calculator also tells you whether the number is prime, how many divisors it has and lists them, which helps with simplifying fractions and finding the GCF or LCM.

Every whole number above 1 is either prime or a product of primes in exactly one way. Breaking a number into its primes is the quickest route to its factors, its greatest common factor with another number, and simplified square roots.

What is prime factorization?

A prime number is a whole number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13 and so on. Every other whole number above 1 is composite and can be built by multiplying primes together. Writing a number as that product is its prime factorization — for example 84 = 2² × 3 × 7.

The fundamental theorem of arithmetic says this factorization is unique: apart from the order of the factors, there is only one way to write a number as a product of primes. That makes the prime factors a kind of fingerprint for the number.

Prime factors are the quickest route to the greatest common factor and least common multiple of two numbers, to simplifying fractions and square roots, and to counting divisors. The difficulty of factoring very large numbers is also what keeps RSA encryption secure.

How to use the prime factorization calculator

  1. Enter a whole number greater than 1.
  2. Read the prime factorization in exponent form and written out.
  3. Check whether the number itself is prime.

Formula

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

The method is trial division: divide by 2 as many times as possible, then by 3, 5, 7 and so on. You only need to test divisors up to √n — anything left over at the end is itself prime.

From the exponents, the number of divisors is (a₁ + 1)(a₂ + 1)…(aₖ + 1). For 360 = 2³ × 3² × 5 that is 4 × 3 × 2 = 24.

Worked examples

Factorising 84 by trial division

Whole number
84
Prime factorization
84 = 2² × 3 × 7
Prime?
No — it is composite
Expanded
2 × 2 × 3 × 7

84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, and 7 is prime. So 84 = 2² × 3 × 7, and it has 12 divisors.

Checking whether a number is prime

Whole number
97
Prime factorization
97 is prime
Prime?
Yes — its only divisors are 1 and itself
Expanded
97

You only need to test primes up to √97 ≈ 9.8 — that is 2, 3, 5 and 7. None divides 97 evenly, so 97 is prime.

A larger number

Whole number
1,001
Prime factorization
1,001 = 7 × 11 × 13
Prime?
No — it is composite
Expanded
7 × 11 × 13

1001 is odd and its digits don’t sum to a multiple of 3, so try 7: 1001 ÷ 7 = 143, then 143 = 11 × 13. So 1001 = 7 × 11 × 13.

Prime factorizations of common numbers

NumberPrime factorizationNumber of divisors
122² × 36
362² × 3²9
602² × 3 × 512
1002² × 5²9
1202³ × 3 × 516
1442⁴ × 3²15
2102 × 3 × 5 × 716
3602³ × 3² × 524
1,0002³ × 5³16
1,0242¹⁰11

What prime factors are good for

360 = 2³ × 3² × 5. From that you can count its divisors without listing them: add 1 to each exponent and multiply, (3 + 1)(2 + 1)(1 + 1) = 24 divisors. Prime factors also simplify roots (√72 = √(2³ × 3²) = 6√2) and give the GCF and LCM of two numbers by comparing their exponents.

Common mistakes

  • Including 1 as a prime factor. 1 is not prime, so it never appears in a prime factorization.
  • Stopping too early with a composite factor, such as writing 72 = 8 × 9. Keep dividing until every factor is prime: 72 = 2³ × 3².
  • Testing divisors beyond the square root. If no prime up to √n divides n, then n is prime — there is no need to go further.
  • Stopping at a composite factor. 60 = 4 × 15 is not finished; keep going to 2² × 3 × 5.

Frequently asked questions

Is 1 a prime number?

No. A prime has exactly two divisors, 1 and itself; 1 has only one. Excluding 1 is what makes every number’s prime factorization unique.

Is 2 the only even prime?

Yes. Every other even number is divisible by 2, so it has at least three divisors.

What is a factor tree?

A diagram that splits a number into two factors, then splits each of those, until only primes remain at the ends of the branches. Whichever way you split, you end up with the same primes.

How do I check whether a number is prime?

Try dividing it by each prime up to its square root. If none divide evenly, it is prime. For 97, you only need to try 2, 3, 5 and 7, since 11² is already 121.

Sources

  1. Prime Factorization, Wolfram MathWorld
  2. Fundamental Theorem of Arithmetic, Wolfram MathWorld
  3. Prealgebra 2e, 2.5: Prime Factorization and the Least Common Multiple, OpenStax, Rice University

Last updated · Calculations checked by automated tests· Editorial policy