Prime Factorization Calculator
Enter any integer from 2 to 1,000,000,000,000 and this calculator instantly finds its prime factorization in exponent form, lists all prime factors, identifies the largest one, and counts the number of divisors.
Find the Prime Factors of a Number
Prime Factorization Formula
Where:
- \(n\) — the integer being factorized (\(n \geq 2\))
- \(p_1, p_2, \ldots, p_k\) — the distinct prime factors of \(n\), in increasing order
- \(a_1, a_2, \ldots, a_k\) — the exponents: how many times each prime divides \(n\)
- \(d(n)\) — the total number of positive divisors of \(n\)
Every integer greater than 1 can be written as a unique product of prime numbers — this is the Fundamental Theorem of Arithmetic. The first line is that unique product; the second line counts how many divisors the number has, based on its exponents.
Prime Factorization – Calculation Example
{p}Example: find the prime factorization of 360, the default value in the calculator.
{/p}
{p}\[ 360 = 2 \times 180 = 2 \times 2 \times 90 = 2 \times 2 \times 2 \times 45 = 2 \times 2 \times 2 \times 3 \times 15 = 2 \times 2 \times 2 \times 3 \times 3 \times 5 \]
{/p}
{p}\[ 360 = 2^3 \times 3^2 \times 5 \]
{/p}
{p}Result: \(360 = 2^3 \times 3^2 \times 5\). It has 3 distinct prime factors (2, 3, 5), 6 prime factors counted with multiplicity, the largest prime factor is 5, and the number of divisors is \(d(360) = (3+1)(2+1)(1+1) = 24\).
{/p}
How to Use the Prime Factorization Calculator
- Type your integer into the Number to factorize (n) field. Any whole number from 2 to 1,000,000,000,000 (10¹²) is accepted; you can also use the arrows to adjust the value.
- Press the calculate button. The results appear immediately below.
- Read the Prime factorization (exponent form) for the compact answer, such as \(2^3 \times 3^2 \times 5\).
- Check the remaining fields: Prime factors (with multiplicity) lists every prime factor individually, Distinct prime factors counts the different primes, Largest prime factor shows the biggest one, and Number of divisors tells you how many positive integers divide your number.
- See Details and how it was calculated for a step-by-step explanation, including the verification that all factors multiply back to your original number.
What Is Prime Factorization?
A prime number is a whole number greater than 1 whose only divisors are 1 and itself — for example 2, 3, 5, 7, 11, and 13. A composite number has other divisors as well. Prime factorization is the process of breaking a composite number down into a product of primes that, when multiplied together, give back the original number.
By the Fundamental Theorem of Arithmetic, this decomposition is unique: there is exactly one way to write any integer greater than 1 as a product of primes (ignoring the order of the factors). That makes prime factorization something like a fingerprint of a number. It is the foundation of many results in number theory, and it powers practical cryptography — the security of RSA encryption, for instance, rests on the fact that factoring very large numbers is computationally hard.
The result is usually written in exponent form: repeated primes are grouped and raised to a power, so \(2 \times 2 \times 2 \times 3 \times 3\) becomes \(2^3 \times 3^2\). The exponents also let you count divisors: if \(n = p_1^{a_1} \times \cdots \times p_k^{a_k}\), then \(n\) has exactly \((a_1+1)(a_2+1)\cdots(a_k+1)\) positive divisors. For 360, that is \(4 \times 3 \times 2 = 24\) divisors.
A classic way to find prime factors by hand is a factor tree: split the number into any two factors, then keep splitting each branch until only primes remain. The calculator does the same thing systematically, using trial division: it divides by 2 and 3 as often as possible, then tests candidates of the form \(6k \pm 1\) (5, 7, 11, 13, …) up to the square root of what remains. Once no candidate up to \(\sqrt{n}\) divides the remainder, the remainder itself must be prime.
Assumptions, Limitations, and Tips
- Range: the calculator accepts integers from 2 to 10¹². Numbers larger than 10¹² exceed what trial division can handle quickly in a browser.
- Integers only: decimals and numbers below 2 are rejected — 1 has no prime factors by definition, and primes start at 2.
- Primes and prime powers: if you enter a prime such as 97, the result simply says the number is prime. If you enter a prime power such as \(128 = 2^7\), you will get a single prime with a large exponent and exactly \(7 + 1 = 8\) divisors.
- Order doesn't matter: \(2 \times 5 \times 2\) and \(2^2 \times 5\) are the same factorization; the calculator always lists primes from smallest to largest.
- Tip: the number of divisors is handy for puzzle problems (e.g., "how many rectangular arrays can 360 tiles form?") and for checking whether a number is a perfect square: a number is a perfect square exactly when every exponent in its factorization is even.
Quick Reference: Common Factorizations
| Number | Prime factorization | Distinct primes | Divisors |
|---|---|---|---|
| 12 | \(2^2 \times 3\) | 2 | 6 |
| 60 | \(2^2 \times 3 \times 5\) | 3 | 12 |
| 100 | \(2^2 \times 5^2\) | 2 | 9 |
| 360 | \(2^3 \times 3^2 \times 5\) | 3 | 24 |
| 720 | \(2^4 \times 3^2 \times 5\) | 3 | 30 |
| 1000 | \(2^3 \times 5^3\) | 2 | 16 |
If you are working on related number theory problems, you may also find our Fermat's Little Theorem calculator, the Digital Root calculator, or the Division calculator useful for checking your arithmetic along the way.
Frequently Asked Questions
How do I find prime factors by hand without a calculator?
Divide the number by the smallest prime that divides it, write down the prime, and repeat with the quotient until you reach 1. Example: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, so \(84 = 2^2 \times 3 \times 7\). A useful shortcut: you only need to test primes up to \(\sqrt{n}\) — if none of them divide the remaining part, that part is itself prime.
Why doesn't 1 have a prime factorization?
A prime must have exactly two distinct divisors: 1 and itself. The number 1 has only one divisor, so it is not prime, and it cannot appear in a prime factorization. If 1 were allowed as a factor, factorizations would no longer be unique (\(6 = 2 \times 3 = 2 \times 3 \times 1\)), breaking the Fundamental Theorem of Arithmetic. That is why this calculator requires inputs of at least 2.
Can I factorize a negative number or zero?
Prime factorization is defined only for integers greater than 1. Zero is divisible by every prime infinitely many times, so it has no factorization, and negative numbers are handled by factoring the absolute value and attaching a minus sign: \(-360 = -(2^3 \times 3^2 \times 5)\). This calculator accepts only whole numbers from 2 upward, so factorize the positive counterpart and add the sign yourself.
How can I use prime factorization to find the GCD or LCM of two numbers?
Factor both numbers into primes. For the GCD, take each common prime raised to the smaller of its two exponents; for the LCM, take each prime that appears raised to the larger exponent. Example with \(360 = 2^3 \times 3^2 \times 5\) and \(84 = 2^2 \times 3 \times 7\): GCD \(= 2^2 \times 3 = 12\), LCM \(= 2^3 \times 3^2 \times 5 \times 7 = 2520\).
How can I tell if a number is prime using its factorization?
A number is prime exactly when its factorization consists of a single prime with exponent 1 — in other words, the number itself. Two quick tests help by hand: if the number has no prime divisor up to its square root, it is prime. This calculator tells you directly: enter the number, and if it reports one distinct prime factor and exactly 2 divisors, the input was prime.
Why does factoring large numbers take so long, and why does this calculator stop at 10¹²?
Trial division must test every candidate up to \(\sqrt{n}\), so the work grows roughly with the size of the number. A 12-digit number needs at most about a million candidate divisions, which a browser handles in an instant, but a 30-digit number with two large prime factors would take far longer. This same difficulty protects RSA encryption: multiplying two big primes is easy, but recovering them from the product is computationally infeasible.
What are common mistakes when factorizing by hand?
The most frequent errors: stopping too early (declaring a leftover like 91 composite-free when \(91 = 7 \times 13\)), forgetting repeated factors (writing \(72 = 2 \times 3\) instead of \(2^3 \times 3^2\)), and treating a non-prime such as 4, 9, or 15 as a final factor. Always split every branch down to numbers whose only divisors are 1 and themselves, then group equal primes into exponents and verify the product equals your original number.