To determine the prime factorization of a whole number, write it as a product of primes, the indivisible building blocks such as 2, 3, 5, 7, and 11 that cannot be split into smaller whole-number factors. By the Fundamental Theorem of Arithmetic, every integer greater than 1 has exactly one such factorization, ignoring the order of the factors: 360 always breaks down to 2 × 2 × 2 × 3 × 3 × 5, and 97, being prime, factorizes to nothing but itself. The practical question is therefore not whether the factorization exists, but how to find it quickly for the specific number sitting in front of you. Trial division answers it by hand, repeatedly dividing by the smallest prime that fits until nothing remains, and the Prime Factorization Calculator runs that same trial-division process for you instantly, including a factor tree and the exponent form.

What Prime Factorization Actually Means
A prime number is a whole number greater than 1 whose only divisors are 1 and itself, so 2, 3, 5, 7, 11, 13, and so on qualify, while 1 does not. A composite number is anything else greater than 1, and it can be split into factors that can usually be split again until every remaining piece is prime. Prime factorization is the act of carrying that splitting all the way down and writing the result as a product of primes.
The reason this is well-defined at all is the Fundamental Theorem of Arithmetic: every integer greater than 1 has exactly one prime factorization, ignoring the order of the factors. Two different people factoring 360 will both arrive at 2³ × 3² × 5; neither will end up with 3 × 5 × 2³ or any other arrangement that changes the underlying multiset of primes. The exponent form is just a notational shortcut: 2³ means three copies of 2 multiplied together (2 × 2 × 2 = 8), so 2³ × 3² × 5 = 8 × 9 × 5 = 360.
| Number | Type | Prime factorization | Exponent form |
|---|---|---|---|
| 2 | Prime | 2 | 2¹ |
| 7 | Prime | 7 | 7¹ |
| 97 | Prime | 97 | 97¹ |
| 4 | Composite | 2 × 2 | 2² |
| 12 | Composite | 2 × 2 × 3 | 2² × 3¹ |
| 360 | Composite | 2 × 2 × 2 × 3 × 3 × 5 | 2³ × 3² × 5¹ |
Why Prime Factorization Comes Up Over and Over
Prime factorization is not just a textbook topic. It is the fastest known route to several problems you will run into at school, on tests, and in real applications.
- Simplifying fractions. To reduce a fraction, factor the numerator and denominator, then cancel every prime they share. 24/36 becomes 2³ × 3 / 2² × 3², then cancel 2² × 3 to reach 2/3.
- Greatest common divisor (GCD). The GCD of two numbers is the product of the primes they have in common, each raised to the smaller of the two exponents. Once you have the factorizations, the GCD practically writes itself.
- Least common multiple (LCM). The LCM is the product of every prime that appears, each raised to the larger exponent across the two numbers. It is the standard companion to GCD whenever you need a common denominator or a periodic schedule.
- Divisor count and sum. If a number n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ, then the number of divisors is (e₁ + 1)(e₂ + 1) … (eₖ + 1), and the sum of divisors is ∏ (pᵢ^(eᵢ+1) − 1) / (pᵢ − 1). Both fall out of the factorization in one step.
- Cryptography. The difficulty of factoring very large numbers is what keeps RSA-style public-key encryption secure; the same operation that finishes a fraction of a second for a 12-digit number becomes infeasible for the 600-digit numbers used in real keys.
How to Find Prime Factors by Hand (Trial Division)
The classical method that any math class will expect you to know is trial division. The recipe is short enough to memorize.
- Start with your number n, assuming n is greater than 1.
- Try dividing by 2 as many times as possible, writing down a 2 each time. Stop when the remainder is no longer 0.
- Move to the next odd prime: 3, then 5, then 7, and so on. Record each prime whenever it divides the running quotient cleanly.
- When the running quotient reaches 1, stop. The primes you wrote down, in order, are the complete prime factorization.
You only need to test primes up to the square root of the running quotient; if anything larger is left over at that point, it must itself be prime. For 360 the square root starts at roughly 19, but the process stops much earlier because 360 runs out of factors at 5.
How to Read a Factor Tree
A factor tree is trial division drawn as a picture. Place the original number at the top, split it into two branches with a small prime factor on one side and the quotient on the other, then repeat on the quotient. When every branch tip is a prime, the factorization is complete.
For 360, the tree starts with 360 → 2 × 180, then 180 → 2 × 90, then 90 → 2 × 45, then 45 → 3 × 15, then 15 → 3 × 5. The leaf nodes are 2, 2, 2, 3, 3, and 5, exactly the same six factors you would get from trial division, just arranged spatially. A factor tree is useful for teaching because the order of splits is flexible (you could split off 5 first instead of 2), and the picture makes it obvious why the answer is unique: the leaves must come out to the same multiset of primes regardless of how you prune the tree.
How to Use the Prime Factorization Calculator
The Prime Factorization Calculator runs trial division for you and shows every useful form of the answer at once. To determine the prime factorization of any whole number:
- Type any whole number greater than 1 into the input box, for example 360.
- Watch the prime factorization, the exponent form (2³ × 3² × 5), and the factor tree update instantly.
- Read off the prime factor list, the total number of divisors, and the indicator that flags whether the number is itself prime.
Everything runs locally in your browser, so no number you type is uploaded to a server. You can use it freely for homework, classroom demonstrations, or any number-crunching you would rather not log.
Worked Example: Factoring 360 From Start to Finish
To show the method end-to-end, take n = 360 and apply trial division.
Step 1. 360 ÷ 2 = 180, so 2 is a factor and we record it. Quotient: 180.
Step 2. 180 ÷ 2 = 90, so 2 is a factor again. Quotient: 90.
Step 3. 90 ÷ 2 = 45, so 2 is a factor a third time. Quotient: 45.
Step 4. 45 is odd, so we move past 2 and try 3. 45 ÷ 3 = 15, so 3 is a factor. Quotient: 15.
Step 5. 15 ÷ 3 = 5, so 3 is a factor again. Quotient: 5.
Step 6. 5 is prime, so we record it once. Quotient: 1. Done.
The recorded factors, in order, are 2, 2, 2, 3, 3, 5. In exponent form this is 2³ × 3² × 5¹. A quick check: 2³ × 3² × 5¹ = 8 × 9 × 5 = 360, matching the original. The calculator returns the same line in a fraction of a second, alongside the visual factor tree and the count of divisors. From the same factorization the full divisor list falls out as 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360, and those 24 divisors sum to 1170.
Pulling Divisor Count and Sum Straight From the Exponents
Once you have the exponent form n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ, two useful totals fall out without any more work. The divisor-count formula is ∏ (eᵢ + 1), which multiplies (exponent + 1) for every prime. The sum-of-divisors formula is ∏ (pᵢ^(eᵢ+1) − 1) / (pᵢ − 1), which sums a geometric series for each prime and then combines the results.
| Quantity | Formula | Substituted for 360 = 2³ × 3² × 5¹ | Result |
|---|---|---|---|
| Divisor count | (e₁+1)(e₂+1)(e₃+1) | (3+1)(2+1)(1+1) | 4 × 3 × 2 = 24 |
| Sum of divisors | ∏ (pᵢ^(eᵢ+1) − 1) / (pᵢ − 1) | 15 × 13 × 6 | 1170 |
Those two numbers, 24 divisors and a divisor sum of 1170, match what the calculator reports next to the factor tree. They also give you a clean way to check your own work: if the calculator reports a count that disagrees with (eᵢ + 1) for one of your primes, you have either mistyped the number or missed a prime during trial division.
How Large a Number the Calculator Can Handle
You can factorize any whole number up to 1,000,000,000,000, which is one trillion. The reason trial division still finishes quickly at that size is that you only need to test prime divisors up to the square root of the number, at most about one million candidates for a 12-digit input, and each test is a single division. Even a tricky case such as 600,851,475,143 = 71 × 839 × 1471 × 6857 returns in well under a second, despite having four prime factors of very different sizes.
Inputs of 0 and 1 are not factorable: 1 has no prime factors by definition, and the calculator flags prime numbers such as 7 or 97 with a single prime and a clear "this number is prime" indicator. You can trust that the factorization shown on screen corresponds to the exact number you typed.
Related reading: How to Find Prime Numbers Up to Any Limit.