Prime Factorization Calculator
Type a whole number up to 100 trillion. The tool tells you whether it is prime and, if not, writes it as a product of primes. It also gives the number of divisors, their sum, the full list of divisors when there are not too many, and the nearest primes on each side.
Prime factors
2³ × 3² × 5
360 = 2³ × 3² × 5
Divisors
24Sum of divisors
1,170Previous prime
359Next prime
3671, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
How it works
- Type a whole number (spaces and commas are ignored).
- Read whether it is prime, or its prime factors with their exponents.
- Check the number of divisors and, for small cases, the list of divisors.
- Copy the result.
What people use it for
Homework and exams
Check a factor tree or find every divisor of a number such as 360.
Fractions
Factor numerator and denominator to simplify a fraction by hand.
Puzzles and codes
Test whether a large number is prime or find the next prime after it.
Questions
- How big a number can I use?
- Up to 100,000,000,000,000 (10¹⁴). Factors are found by trial division by 2, 3 and numbers of the form 6k ± 1, which is exact; beyond this limit the page could freeze your browser.
- Is 1 prime?
- No. A prime has exactly two divisors, 1 and itself, and 1 has only one. It is also not composite: the tool says it is neither.
- How are the previous and next prime found?
- By testing each neighbouring number with the Miller-Rabin test, using twelve fixed bases, which is exact for every number this tool accepts.
- How are the number and the sum of divisors computed?
- From the exponents: a number p₁^e₁ × p₂^e₂ … has (e₁ + 1)(e₂ + 1)… divisors, and their sum is the product of (p^(e+1) − 1) ÷ (p − 1) for each prime. For 360 = 2³ × 3² × 5 that is 24 divisors adding up to 1170.