Free online prime factorization calculator
Prime factorization breaks a number into a product of prime numbers. Enter any positive integer to see its factors, exponent form, and all divisors.
Saved to favorites
Your favorites are on the home page under “Your favorites.” They are saved only in this browser on this device, so they will not appear on another device or browser. No account, no server.
How to use
- Enter a positive integer in the input field.
- Click Factorize.
- See the prime factorization in exponent form, total divisors, and every divisor listed.
How it works
The algorithm uses trial division:
- Start with divisor d = 2.
- While d² ≤ n, check if d divides n.
- If yes, record d as a factor and replace n with n ÷ d.
- If no, increment d.
- If n > 1 after the loop, n itself is prime and is the last factor.
Formula: number of divisors
For n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ:
Number of divisors = (a₁ + 1)(a₂ + 1) … (aₖ + 1)
Worked example
360 = 2³ × 3² × 5
- Prime factors: 2, 2, 2, 3, 3, 5
- Exponent form: 2³ × 3² × 5¹
- Number of divisors: (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24
- 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
References
- Fundamental theorem of arithmeticWikipedia · en.wikipedia.org
- Prime FactorizationWolfram MathWorld · mathworld.wolfram.com
Frequently asked
What is prime factorization?
Prime factorization expresses a number as a product of prime numbers. Every integer greater than 1 has a unique prime factorization — this is the Fundamental Theorem of Arithmetic. For example, 360 = 2³ × 3² × 5.
How does the calculator find prime factors?
The algorithm divides the number by each prime starting at 2. When a prime divides evenly, it records that factor and continues with the quotient. This repeats until the quotient is 1.
How is the number of divisors calculated?
If n = p₁^a × p₂^b × p₃^c …, then the number of divisors is (a+1)(b+1)(c+1)…. For 360 = 2³ × 3² × 5¹, divisors = (3+1)(2+1)(1+1) = 4×3×2 = 24.
Is 1 a prime number?
No. 1 is neither prime nor composite. By convention, prime factorization starts at 2. The number 1 has no prime factors.
What is the largest number this calculator handles?
The calculator handles numbers up to about 999,999,999. Larger numbers may be slow because trial division runs up to the square root of the input.
Embed this calculator
Add this free calculator to your own site. Copy the snippet — it works anywhere you can paste HTML, and stays in sync with this page.