Prime Factorization Calculator

Break any whole number up to 10^18 into primes, see the factor tree and division ladder, and get every divisor with its count and sum.

Free, no sign-upRuns in your browserUpdated November 2026
Try:
Prime factorisation
—
Prime or composite
—
Number of divisors
—
Sum of divisors
—
Perfect square / cube
—
Factor tree
Working
All divisors (factors)
—

How to use the Prime Factorization Calculator

  1. Type a whole number from 1 to 1018 into the box, or tap one of the examples.
  2. Read the prime factorisation in exponent form, for example 360 = 2³ × 3² × 5. It updates as you type.
  3. Follow the factor tree and the division ladder to see how the number was broken down, smallest prime first.
  4. Check the number of divisors, their sum, the prime check and the perfect square/cube test, then copy the full list of divisors.

What is prime factorisation?

A prime number has exactly two divisors: 1 and itself (2, 3, 5, 7, 11, …). Every whole number greater than 1 is either prime or can be written as a product of primes. The Fundamental Theorem of Arithmetic, which you meet in the Real Numbers chapter of NCERT Class 10, says this product is unique apart from the order of the factors. So 360 is 2 × 2 × 2 × 3 × 3 × 5 and nothing else, written in exponent form as 2³ × 3² × 5.

This calculator finds that product for any number up to 1018. It uses exact whole-number (BigInt) arithmetic, so there is no rounding. Small factors are removed by trial division. A deterministic Miller–Rabin test checks whether what is left is prime, and Pollard's rho algorithm splits large composite numbers. That makes even an 18-digit number with two large prime factors take a fraction of a second.

Two school methods

Factor tree

Write the number at the top and split it into two factors. Keep splitting every branch that is not prime. The leaves at the bottom are the prime factors. The tree above always splits off the smallest prime first, which is the neatest way to draw it in an exam.

Division (ladder) method

Divide by the smallest prime that goes in exactly, write the quotient underneath and repeat until you reach 1. The primes down the left side are the factors.

2 | 360 2 | 180 2 | 90 3 | 45 3 | 15 5 | 5 | 1 → 360 = 2³ × 3² × 5

Divisors from the factorisation

Once you have n = p1a × p2b × p3c × …, you do not need to hunt for divisors one by one. Every divisor picks an exponent from 0 to a for p1, from 0 to b for p2, and so on.

Number of divisors d(n) = (a + 1)(b + 1)(c + 1) … Sum of divisors σ(n) = [(p₁^(a+1) − 1)/(p₁ − 1)] × [(p₂^(b+1) − 1)/(p₂ − 1)] × …

Worked example (n = 360 = 2³ × 3² × 5¹)

  • Number of divisors = (3 + 1)(2 + 1)(1 + 1) = 4 × 3 × 2 = 24.
  • Sum of divisors = (2⁴ − 1)/1 × (3³ − 1)/2 × (5² − 1)/4 = 15 × 13 × 6 = 1170.
  • 360 is not a perfect square, because the exponents 3 and 1 are odd. It is not a perfect cube, because 2 and 1 are not multiples of 3.

Reading the results

What you seeWhat it means
Only one prime with exponent 1The number is prime: exactly 2 divisors
All exponents evenPerfect square: √n = product of pe/2
All exponents multiples of 3Perfect cube: ∛n = product of pe/3
Odd number of divisorsAlways a perfect square, because divisors pair up as d and n/d except √n
1Neither prime nor composite; it has no prime factors

Common mistakes

  • Calling 1 a prime. It is not. A prime needs exactly two different divisors.
  • Stopping at a composite leaf. 4, 9, 15, 21, 49 and 91 (= 7 × 13) are not prime. Keep splitting.
  • Forgetting the exponent + 1. The number of divisors of 2³ × 3² is (3 + 1)(2 + 1) = 12, not 3 × 2 = 6. The +1 counts the choice of using a prime zero times.
  • Testing too far. To check whether n is prime by hand you only need to try primes up to √n. For 97, try 2, 3, 5 and 7; none divide it, so 97 is prime.

Exam tips

  • CBSE Class 10 asks you to "express as a product of prime factors". Show the tree or ladder, then the exponent form.
  • HCF and LCM come straight from the factorisation. HCF takes the lowest power of each common prime and LCM takes the highest power of every prime. Try the LCM and HCF calculator to see this as a table.
  • To prove a number like √6 is irrational, the standard NCERT argument uses the fact that if a prime p divides a², then p divides a, which comes from unique factorisation.
  • Divisor counting appears in permutations and combinations problems too. See the permutation and combination calculator.

Frequently asked questions

What is the prime factorisation of 360?
360 = 2 × 2 × 2 × 3 × 3 × 5, or 2³ × 3² × 5 in exponent form. It has (3 + 1)(2 + 1)(1 + 1) = 24 divisors, and their sum is 1170.
Is 1 a prime number?
No. A prime has exactly two different divisors, 1 and itself. The number 1 has only one divisor, so it is neither prime nor composite. Excluding it keeps prime factorisations unique.
How do you find the number of factors of a number?
Write the prime factorisation n = pa × qb × rc…, add 1 to each exponent and multiply: (a + 1)(b + 1)(c + 1)…. For 72 = 2³ × 3², that gives 4 × 3 = 12 factors.
How large a number can this calculator factorise?
Any whole number up to 1018. It combines trial division with a deterministic Miller–Rabin primality test and Pollard’s rho algorithm, so even 18-digit numbers usually finish almost instantly in your browser.
How can I tell if a number is a perfect square from its prime factors?
A number is a perfect square exactly when every exponent in its prime factorisation is even, and a perfect cube when every exponent is a multiple of 3. For example 3600 = 2⁴ × 3² × 5² is a square (60²).
What is the difference between a factor tree and the division method?
Both give the same primes. A factor tree splits the number into any two factors and keeps branching. The division (ladder) method divides repeatedly by the smallest prime. The ladder is quicker for large numbers and is also used for HCF and LCM.

Last reviewed November 2026. Results are estimates for information only — see our disclaimer.