Prime Factorization Calculator
Break a number into prime factors, with a factor tree, all divisors and a prime check
Loading the tool…
Breaks a whole number into prime factors such as 2³ × 3² × 5, lists all its divisors with their count and sum, and tells you whether the number is prime.
How to use
- On the "Factorize" tab, enter a whole number of up to 60 digits in "Number". Expressions such as 2^61-1 work too.
- Under "Working", choose "Divide by primes" or "Factor tree" to see the steps as a picture.
- "Divisors" lists every divisor and the divisor pairs; "Copy divisors" copies them.
- The "Sieve of Eratosthenes" tab plays the sieve with "Play", and "Prime lists" finds the primes in a range and the "n-th prime".
How it works
- Every whole number greater than 1 has exactly one prime factorization, apart from order. If n = p^a × q^b, the number of divisors is (a + 1) × (b + 1).
- Small factors are found by trial division, large ones with Pollard's rho method. If the search takes more than about three seconds, the result is marked "Partly factorized".
- Primality is proven below 3.3 × 10²⁴; above that a strong probable-prime test is used. "Prime lists" works up to 10¹², with at most 1,000,000 numbers at a time.
Questions and answers
- How do you find the prime factorization of a number?
- Keep dividing by the smallest prime that goes in exactly until the quotient is 1. 360 ÷ 2 ÷ 2 ÷ 2 ÷ 3 ÷ 3 ÷ 5 = 1, so 360 = 2³ × 3² × 5.
- How do I count the divisors of a number?
- Factorize it, add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5 that is (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors.
- Is 1 a prime number?
- No. 1 is neither prime nor composite. A prime has exactly two divisors: 1 and itself.
- Is 2 a prime number?
- Yes. Its only divisors are 1 and 2, and it is the only even prime.