Prime Factorization Calculator
Break any whole number up to a trillion into prime factors with divisor count, divisor sum and the full list of divisors. The Fundamental Theorem of Arithmetic says every whole number above 1 is either prime or a product of primes in exactly one way. Example: with whole number 360, the result is Prime factorization = 2^3 × 3^2 × 5.
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Step-by-Step Solution
How do you use the Prime Factorization Calculator?
Enter a whole number from 2 up to one trillion. The calculator returns its prime factorization written with exponents, tells you whether the number is prime, and gives the number of divisors, the sum of the divisors and, for numbers with 64 or fewer divisors, the full list.
The Step-by-Step Solution shows the repeated division used to find each prime factor, so you can follow it by hand or check your own working.
What formula does the Prime Factorization Calculator use?
The Fundamental Theorem of Arithmetic says every whole number above 1 is either prime or a product of primes in exactly one way. To find that product, divide by the smallest prime that fits (2, then 3, 5, 7, and so on), replace the number by the quotient and repeat. You only need to try primes up to the square root of the remaining number, because if no factor is found by then, what remains is prime.
Once you have the factorization n = p₁^e₁ × p₂^e₂ × …, the number of divisors is (e₁ + 1)(e₂ + 1)… and the sum of divisors is the product of (p^(e+1) − 1) ÷ (p − 1) for each prime.
Worked example: 360
360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, then 45 ÷ 3 = 15, ÷ 3 = 5, and 5 is prime. So 360 = 2³ × 3² × 5. The number of divisors is (3 + 1)(2 + 1)(1 + 1) = 24, and their sum is 15 × 13 × 6 = 1,170. The divisors range from 1 up to 360 and include 2, 3, 4, 5, 6, 8, 9, 10, 12 and so on. For a prime like 97, the factorization is just itself, with exactly two divisors: 1 and 97.
Why prime factorization matters
Factorization is used to simplify fractions, find the greatest common divisor and least common multiple, and work out how many ways a number can be split into equal groups. If you have the prime factorizations of two numbers, the GCD uses the lowest power of each shared prime and the LCM uses the highest.
It also matters in cryptography. Multiplying two large primes is easy, but recovering them from the product is extremely hard, and RSA encryption relies on that difficulty. The numbers handled here are tiny by those standards, which is why they factor instantly.
What are the most common mistakes with the Prime Factorization Calculator?
- Treating 1 as a prime. By definition primes have exactly two divisors, and 1 has only one.
- Stopping early and leaving a composite number in the answer.
- Forgetting repeated factors, such as writing 12 as 2 × 3 instead of 2 × 2 × 3.
- Confusing prime factors with all factors. 12 has prime factors 2 and 3 but divisors 1, 2, 3, 4, 6 and 12.
What Is the Tested Example for the Default Values?
This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.
| Input: Whole number | 360 |
|---|---|
| Prime factorization | 2^3 × 3^2 × 5 |
| Is it prime? | No |
| Number of divisors | 24 |
| Sum of divisors | 1170 |
| All 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 |
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
How do I find the prime factors of a number?
Divide by the smallest prime that goes in, then repeat with the quotient until you reach 1. The primes you used are the prime factors.
Is 1 a prime number?
No. A prime has exactly two distinct divisors, 1 and itself, and 1 has just one divisor.
How can I tell if a number is prime?
If it has no prime factor up to its square root, it is prime. This calculator reports it directly.