Maths

Prime Factorization Calculator

Break any whole number up to 10¹² into prime factors, with powers and the number of divisors.

By Nitin Raturi · Last reviewed

Your number

How to use the Prime Factorization Calculator

Break a whole number into its prime factors.

  1. Enter a whole number.
  2. Read the prime factorisation in exponent form.
  3. Check the expanded form and the number of divisors.

Good to know

  • 1 is neither prime nor composite, so the smallest number accepted is 2.

Any whole number from 2 to 10¹².

Whole number

The number to break into primes.

How to fill it in

  • Enter a whole number from 2 to 1,00,00,00,00,000 (10¹²).
  • Commas are fine: 3,60,360.

Example

120 = 2³ × 3 × 5; 48 = 2⁴ × 3.

Tip: A prime such as 97 has only itself as a prime factor.

Prime factors of 120

2³ × 3 × 5

120 = 2 × 2 × 2 × 3 × 5.

Prime?
No
Number of divisors
16
Sum of divisors
360

Every whole number above 1 has exactly one prime factorisation (the fundamental theorem of arithmetic). Factors are listed smallest first.

How this calculator works

  1. Step 1Try 2, then 3÷ 2, ÷ 3Divide out each as many times as it goes.
  2. Step 2Then 5, 7, 11…6k ± 1Only numbers next to multiples of 6 can be prime.
  3. Step 3Stop at the root√nWhatever is left above 1 is itself prime.

Every whole number above 1 can be written as a product of primes in exactly one way. The calculator divides out the smallest primes first, like the ladder method taught in school.

Worked example: 120

Prime factors of 120 by the ladder method
Ladder
divide by the smallest prime that goes
  1. 120 ÷ 260
  2. 60 ÷ 230
  3. 30 ÷ 215
  4. 15 ÷ 35 (prime)
  5. So 120 =2³ × 3 × 5

This matches OpenStax’s Example 2.50. Their Examples 2.48 and 2.49 give 48 = 2⁴ × 3 and 84 = 2² × 3 × 7.

Prime or composite

  • Prime97Its only factors are 1 and itself.
  • Composite12016 divisors in all.

Read the result

The headline is the factorisation with powers; the line beneath writes every factor out.

The number of divisors is the product of each power plus one: for 120, (3 + 1)(1 + 1)(1 + 1) = 16.

Assumptions and limits

  • Whole numbersFrom 2 to 10¹², so results are instant.
  • Unique answerOrder does not matter; factors are listed smallest first.

Prime factors are the building blocks of a number. Factors, LCM and HCF follow from them.

To list every factor and factor pair, use the factor calculator. For the LCM and HCF of several numbers, try the LCM and HCF calculator, and to simplify a square root, the root calculator.

Common mistakes

  • Mistake: Stopping at a composite factor such as 4.

    Instead: Keep dividing until every factor is prime: 4 = 2².

  • Mistake: Calling 1 a prime.

    Instead: 1 has only one factor, so it is neither prime nor composite.

Checking the method

Every golden case is rechecked with a sieve of primes and a full list of divisors.

An independent script builds every prime below a million with the sieve of Eratosthenes, factorises each number with them, and counts divisors directly.

Read how we test our calculators, or browse more maths calculators.

Frequently asked questions

What is the prime factorisation of 120?

120 = 2³ × 3 × 5, found by dividing by 2 three times and then by 3.

What is the prime factorisation of 48?

48 = 2⁴ × 3: 2 goes into 48 four times, leaving 3.

What is the prime factorisation of 84?

84 = 2² × 3 × 7: divide by 2 twice, then 3, leaving the prime 7.

How can I tell if a number is prime?

If its only prime factor is itself, it is prime. 97 is prime.

How is the number of divisors worked out?

Add one to each power and multiply. For 120 that gives 16.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 3 Nov 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release.