Prime Factorization Calculator

Break a whole number into the primes that multiply to make it, step by step, or list the first N primes or every prime between two numbers.

Mode

Type a whole number from 2 to 1,000,000,000,000, such as 3780.

Prime factorisation of 3,780

2^2 × 3^3 × 5 × 7

= 2 × 2 × 3 × 3 × 3 × 5 × 7

Division ladder
Number÷ smallest primeResult
3,78021,890
1,8902945
9453315
3153105
105335
3557
771
  • Distinct primes4
  • Total prime factors (with repetition)7
  • Number of divisors(2+1)×(3+1)×(1+1)×(1+1) = 48
  • Square-freeNo

How this was calculated

  1. A prime is a number that only 1 and itself divide, like 2, 3, 5 and 7. Start with the smallest prime, 2. Divide by it as long as it goes in exactly, then move on to 3, 5, 7 and so on, until you reach 1.3,780 ÷ 2 = 1,890; 1,890 ÷ 2 = 945; 945 ÷ 3 = 315; 315 ÷ 3 = 105; 105 ÷ 3 = 35; 35 ÷ 5 = 7; 7 ÷ 7 = 1You only need to test primes up to √3,780 ≈ 61.48. If nothing up to there divides what is left, what is left is prime itself.
  2. Write down every prime you divided by. Multiplied together, they give back your number.3,780 = 2 × 2 × 3 × 3 × 3 × 5 × 7
  3. Write repeated primes as a power to make it shorter. A power says how many copies are multiplied, so 2 × 2 × 2 is 2^3.3,780 = 2^2 × 3^3 × 5 × 7Every whole number above 1 has exactly one set of prime factors (the fundamental theorem of arithmetic).

Prime factorization in simple words

A prime number is a whole number bigger than 1 that only 1 and itself divide. The first few are 2, 3, 5, 7, 11 and 13.

Prime factorization means writing a number as primes multiplied together. It is like breaking a number into its smallest building blocks.

Example: to break up 60, divide by 2 to get 30, divide by 2 again to get 15, divide by 3 to get 5, and 5 is prime. So 60 = 2 × 2 × 3 × 5, which is written 2² × 3 × 5.

Every whole number above 1 breaks up into primes in only one way. The order does not matter: 2 × 3 × 2 × 5 is still the same set of primes.

Repeated division by primes

Divide by 2 until the result is odd, then test odd divisors up to the square root of the remaining value. Each successful divisor is prime because its smaller factors have already been removed. Any remainder above 1 after this process is prime.

Every integer greater than 1 has a unique prime factorization, apart from the order of its factors. Exponents collect repeated factors into a compact product.

Example: factor 3,780

3,780 ÷ 2 = 1,890; ÷ 2 = 945; ÷ 3 = 315; ÷ 3 = 105; ÷ 3 = 35; ÷ 5 = 7; ÷ 7 = 1. Therefore 3,780 = 2² × 3³ × 5 × 7.

There are four distinct primes and seven factors with repetition. The number of positive divisors is (2 + 1)(3 + 1)(1 + 1)(1 + 1) = 48.

Reading the result

A square-free number has no repeated prime factor. For example, 30 = 2 × 3 × 5 is square-free; 12 = 2² × 3 is not. An input that is already prime produces a one-step ladder.

Use integers from 2 through 10¹². The number 1 has no prime factors, and decimals or negative inputs are not accepted. Factorization runs in your browser; inputs near the upper limit may take longer.

Listing primes

The “First N primes” mode lists up to 10,000 primes using the sieve of Eratosthenes; the 10,000th prime is 104,729. The “Primes between a and b” mode runs a segmented sieve: it crosses out multiples of every prime up to √b inside the range, leaving only primes.

Ranges can end as high as 10¹² and span up to 1,000,000 numbers. For example, there are 25 primes below 100 and 21 primes between 100 and 200.

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two positive divisors. The number 1 has only one, so including it would also destroy uniqueness of prime factorizations.

How does prime factorization help with roots?

An even exponent under a square root can be halved and brought outside it. For example, √72 = √(2³ × 3²) = 6√2.

How many primes can I list at once?

Up to 10,000 in first-N mode, or every prime in a range spanning up to 1,000,000 numbers. The first 2,000 are displayed, and the count covers them all.

References

Last updated . Results are estimates for informational purposes only.