Prime Factorization Calculator

Prime factorization2^3 × 3^2 × 5
Prime or compositeComposite
Number of divisors24
Sum of all divisors1,170
Largest prime factor5
How this was calculated
  1. Trial division peels off the smallest prime again and again: 360 = 2^3 × 3^2 × 5. Every whole number above 1 has exactly one such expansion — the fundamental theorem of arithmetic.
  2. The divisor count comes from the exponents: (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors. Adding 1 to each exponent counts, for every prime, the choice of using it 0 up to e times.
  3. The divisors pair up around √360 ≈ 18.97, and they sum to 1,170 including the number itself.

Use this prime factorization calculator to break any integer above 1 into its prime building blocks. Enter a number and the tool returns the full prime factorization, the total count of divisors, and the sum of those divisors. Every integer above 1 factors into primes in exactly one way — the fundamental theorem of arithmetic — so the result is never ambiguous. For example, 360 = 2^3 × 3^2 × 5, with 24 divisors summing to 1,170. A prime like 97 simply yields itself, with 2 divisors summing to 98. A power of two like 1024 = 2^10 has 11 divisors summing to 2,047.

The calculator relies on trial division, the accepted standard for this kind of calculation. It only needs primes up to √n, so for numbers up to a trillion that is a million — still instant for small primes with early exit. The divisor count multiplies (exponent + 1) across the factorization: (3+1)(2+1)(1+1) = 24 for 360. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify every result yourself.

Worked examples

360 — highly composite

Primary result: 2^3 × 3^2 × 5. (360)

Prime factorization2^3 × 3^2 × 5
Prime or compositeComposite
Number of divisors24
Sum of all divisors1,170
Largest prime factor5

97 — prime

Primary result: 97. (97)

Prime factorization97
Prime or compositePrime
Number of divisors2
Sum of all divisors98
Largest prime factor97

1024 — a pure power of two

Primary result: 2^10. (1024)

Prime factorization2^10
Prime or compositeComposite
Number of divisors11
Sum of all divisors2,047
Largest prime factor2

Every number, one factorization

Every integer above 1 factors into primes in exactly one way. That statement, known as the fundamental theorem of arithmetic, means no matter how you break a number down, you always arrive at the same set of prime factors. A prime factorization calculator applies this principle so you can trust the result is both complete and unique.

Consider 360, which equals 2^3 × 3^2 × 5. The exponents also tell you how many divisors the number has. The divisor count multiplies (exponent + 1) across the factorization: (3+1)(2+1)(1+1) = 24 for 360, and those 24 divisors sum to 1,170. A prime number such as 97 is its own factorization, with 2 divisors summing to 98. A pure power of 2 such as 1024 equals 2^10, giving 11 divisors summing to 2,047.

The method behind the scenes is trial division. It only needs primes up to √n, because any factor larger than that root would have already been paired with a smaller one. For numbers up to a trillion, that means checking primes only up to a million, which is still instant for small primes when the code exits early the moment no further factor remains.

Worked examples

The table below walks through three verified cases that show how a prime factorization calculator handles different types of integers. Every integer above 1 factors into primes in exactly one way — this is the fundamental theorem of arithmetic — so each result below is the unique correct answer for that number.

The first case, 360, is a highly composite number. It breaks into three distinct primes raised to different powers: 360 = 2^3 × 3^2 × 5. The divisor count multiplies (exponent + 1) across the factorization, giving (3+1)(2+1)(1+1) = 24 divisors that sum to 1,170. The second case, 97, is prime. Its factorization is itself, so it has just 2 divisors (1 and 97) that sum to 98. The third case, 1024, is a pure power of two: 1024 = 2^10. It has 11 divisors summing to 2,047.

These examples also illustrate why trial division is fast enough for everyday use. Trial division only needs primes up to √n — for numbers up to a trillion that is a million, still instant for small primes with early exit. When a number is prime, early exit happens immediately because no prime divisor is found before reaching √n. When a number has small prime factors, they are divided out first, shrinking the remaining value quickly and reducing the work needed for later steps.

NumberTypeFactorizationDivisor countDivisor sum
360Highly composite2^3 × 3^2 × 5241,170
97Prime97298
1024Pure power of two2^10112,047
The divisor count multiplies (exponent + 1) across the factorization: (3+1)(2+1)(1+1) = 24 for 360.

Trial division, step by step

Trial division is the most straightforward method a prime factorization calculator uses to break a number into its prime factors. You start by dividing the number by the smallest prime, which is 2, and keep dividing by 2 as long as the result is even. Once the number no longer divides evenly by 2, you move on to the next prime, 3, and repeat the process. You continue stepping through successive primes — 5, 7, 11, 13, and so on — until the number has been fully reduced to 1. At that point, the list of primes you divided by forms the complete prime factorization.

Consider 360 as an example. Dividing by 2 three times in a row gives 45, so you record 2 three times. Moving to the next prime, 3 divides 45 twice to give 5, so you record 3 twice. Finally, 5 divides once to give 1. The result is 360 = 2^3 × 3^2 × 5, which the fundamental theorem of arithmetic guarantees is the unique way to express 360 as a product of primes. From this factorization you can also derive other properties: the divisor count multiplies (exponent + 1) across the factorization, giving (3+1)(2+1)(1+1) = 24 divisors that sum to 1,170.

A key optimization limits how far you need to go. Trial division only needs primes up to √n, the square root of the number you are factoring. The reason is simple: if a number has two factors both larger than its square root, multiplying those factors would produce a number larger than the original. So if no prime divisor has been found by the time you reach √n, the remaining number must itself be prime. For example, 97 has no divisors among the primes up to √97 (which is roughly 9.8), so 97 is prime — its factorization is itself, with 2 divisors summing to 98.

This square-root cutoff makes trial division practical even for large inputs. For numbers up to a trillion, √n is a million, and checking divisibility by small primes with early exit is still instant on modern hardware. A number like 1024, for instance, divides by 2 repeatedly until it reaches 1, yielding 1024 = 2^10 with 11 divisors summing to 2,047 — all in a fraction of a second.

What the exponents tell you

Once a prime factorization calculator gives you the exponents in a number's prime factorization, you can read two useful values straight off them: the total count of divisors and the sum of those divisors. The fundamental theorem of arithmetic guarantees that every integer above 1 factors into primes in exactly one way, so these results are determined entirely by that unique set of exponents.

The divisor count comes from multiplying one more than each exponent across the full factorization. For each prime raised to an exponent, you add one to that exponent and multiply these adjusted values together. The verified example of 360 illustrates this clearly. Its factorization is 2^3 × 3^2 × 5, and applying the rule gives (3+1)(2+1)(1+1) = 24 for 360. That means 360 has exactly 24 divisors. A prime number follows the same logic: 97 is prime, so its factorization is itself, with 2 divisors summing to 98. The exponent on 97 is 1, and (1+1) = 2, confirming the two divisors.

The divisor sum uses a related pattern. For each prime power in the factorization, you add the powers from zero up to the exponent and then multiply these sums across all the primes. For 360, that means (1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5), which equals 15 × 13 × 6 = 1,170. So the 24 divisors of 360 sum to 1,170. For a pure prime power like 1024 = 2^10, the calculation simplifies to a single sum: 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 = 2,047. That gives 11 divisors summing to 2,047, which matches the divisor count formula since (10+1) = 11.

These exponent-based shortcuts work because trial division, the method a prime factorization calculator uses to find the factors, only needs primes up to the square root of the number being factored. For numbers up to a trillion, that is a million, still instant for small primes with early exit when the remaining value drops to 1. Once the factorization is complete, the exponents contain everything needed to determine both how many divisors exist and what they add up to, without listing them individually.

Key rule: To count divisors, add 1 to each exponent in the prime factorization and multiply those values together. For 360 = 2^3 × 3^2 × 5, that gives (3+1)(2+1)(1+1) = 24 divisors.

Factorization powers GCF and LCM

Every integer above 1 factors into primes in exactly one way, a result known as the fundamental theorem of arithmetic. This guarantee is what makes a prime factorization calculator so powerful for finding the greatest common factor (GCF) and least common multiple (LCM) of two numbers. Because each number has a single, unique prime factorization, the GCF and LCM fall out mechanically — you simply compare exponents across the shared primes.

To find the GCF, take the minimum exponent for each prime that appears in both factorizations. To find the LCM, take the maximum exponent for each prime that appears in either. No guessing or trial checking is needed. For example, 360 = 2^3 × 3^2 × 5, and 1024 = 2^10. The GCF uses the smaller power of 2, which is 3, giving 2^3 = 8. The LCM uses the larger power of 2, which is 10, and carries along the other primes from 360, giving 2^10 × 3^2 × 5 = 460,800. The unique factorization ensures this process always produces the correct answer.

The same factorization also reveals how many divisors a number has and what they add up to. The divisor count multiplies (exponent + 1) across the factorization. For 360, that calculation is (3+1)(2+1)(1+1) = 24, so 360 has exactly 24 divisors summing to 1,170. A prime number behaves simply: 97 is prime, so its factorization is itself, with 2 divisors summing to 98. A pure power of two like 1024 = 2^10 has 11 divisors summing to 2,047. These relationships hold for every integer above 1 because the underlying factorization never changes.

Behind the scenes, the factorization itself comes from trial division, which only needs primes up to √n. For numbers up to a trillion, that ceiling is a million, still instant for small primes with early exit. Once a number is fully factored, the GCF, LCM, divisor count, and divisor sum all follow directly from the exponents — no further searching required.

From homework to cryptography

A prime factorization calculator handles the same core operation whether you are simplifying a fraction for homework or cracking a message scrambled with RSA encryption. The difference is not the operation but the scale. Every integer above 1 factors into primes in exactly one way, a result known as the fundamental theorem of arithmetic. That guarantee is what makes the math dependable enough to use both in a classroom and in a cryptographic system protecting financial transactions.

Consider how quickly the numbers reveal patterns. Take 360, which factors as 2^3 × 3^2 × 5. Because the divisor count multiplies (exponent + 1) across the factorization, you get (3+1)(2+1)(1+1) = 24 divisors, and those divisors sum to 1,170. A prime like 97 is simpler: its factorization is itself, giving it just 2 divisors that sum to 98. Then there is 1024, which equals 2^10 and has 11 divisors summing to 2,047. Each example is trivial for a modern tool to break apart and analyze.

The method behind a straightforward prime factorization calculator is often trial division, and it is more efficient than it sounds. Trial division only needs primes up to √n. For numbers up to a trillion, that ceiling is a million, which remains instant for small primes when the algorithm uses early exit. A 12-digit number is therefore no obstacle. The approach scales smoothly until the inputs grow to a size where even the square root becomes an enormous range to search.

That is precisely where cryptography enters. The same problem that takes milliseconds at a few digits becomes intractable at 300 digits. RSA encryption relies on multiplying two large primes to produce a composite number that serves as a public key. Factoring that composite back into its components is easy to state and hard to do, because size is the whole difference. A number with 300 digits has a square root with roughly 150 digits, and no shortcut is known that makes searching that space practical with current technology.

FAQs

How do you find the prime factorization of a number?

Divide out the smallest prime repeatedly. For example, 360 ÷ 2 ÷ 2 ÷ 2 ÷ 3 ÷ 3 ÷ 5 leaves 2^3 × 3^2 × 5. You keep dividing by the smallest prime that fits until nothing remains but 1. The collected primes, written with exponents, give the full factorization.

What is the prime factorization of 97?

It is 97 itself. The number 97 has no divisor besides 1 and 97, so it is prime. Prime numbers are their own prime factorization because they cannot be broken into smaller whole-number factors.

How many divisors does 360 have?

Multiply (exponent + 1) for each prime in the factorization. Since 360 = 2^3 × 3^2 × 5, you get (4)(3)(2) = 24 divisors. Each exponent is increased by one and the results are multiplied together to count every possible divisor.

What is the prime factorization of 1024?

It is 2^10. Ten doublings of 2 produce 1024, which is why 1024 is the binary kilobyte. Since 1024 is a power of 2, its only prime factor is 2, repeated ten times.

Why is prime factorization unique?

Every composite number is built from primes, and the building list, with repetition, is unique. Primes are the atoms of multiplication. No matter how you factor a number, you always arrive at the same set of prime factors in the end.

Why is factoring large numbers hard?

Trial division is instant at this size. The hard instances behind cryptography have hundreds of digits and no known shortcut. For such numbers, checking every possible prime divisor would take far longer than practical, which is what makes factoring them a foundation of modern encryption.

Sources

Related calculators

Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.
Geometric Mean Calculator
The multiplicative average of two, three or four numbers — the right mean for growth rates and ratios — shown next to the arithmetic mean.
LCM & GCF Calculator
Least common multiple and greatest common factor for two or three numbers, from their prime factorizations — the way that shows why the answer is right.