Skip to content
MoneyDeck

Prime Factorization Calculator

Break any number into prime factors, with exponents and ladder steps

Updated · Free, no signup

Any whole number from 2 to 1,000,000,000,000.

Prime factorization

360 = 2³ × 3² × 5

Expanded form

2 × 2 × 2 × 3 × 3 × 5

Is it prime?

No, composite

Distinct prime factors

3

Prime factors counted with multiplicity

6

Number of divisors

24

Sum of divisors

1,170

  • 360 has 24 divisors in total, found by multiplying (exponent + 1) for each prime.

Division ladder (factor tree steps)

StepNumberDivide by primeQuotient
13602180
2180290
390245
445315
51535
6551

About the Prime Factorization Calculator

This prime factorization calculator splits a whole number into the primes that multiply to make it — for example 360 = 2³ × 3² × 5. Enter any integer from 2 up to one trillion and you get the factorization in exponent form, the fully expanded product, whether the number is itself prime, and a step-by-step division ladder that mirrors the factor tree taught in school.

Prime factors are the building blocks behind many other calculations: finding the greatest common factor and least common multiple, simplifying fractions and square roots, and counting divisors. Students use it to check factor trees, and puzzle and number-theory fans use it to explore large numbers quickly.

Every whole number greater than 1 has exactly one prime factorization (the Fundamental Theorem of Arithmetic), so the order of the factors does not matter. The numbers 0 and 1 have no prime factorization.

How to use the prime factorization calculator

  1. 1Enter a whole number of 2 or more.
  2. 2Read the prime factorization in exponent form at the top.
  3. 3Follow the division ladder: each row divides by the smallest prime that fits.
  4. 4Use the expanded form or divisor counts for GCF, LCM or fraction work.

Formula and method

n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ; divisors d(n) = (a₁+1)(a₂+1)…(aₖ+1)

The calculator first uses trial division: it divides the number by 2 as many times as possible, then by 3, then by 5, 7, 11 and so on up to 1,000 (checking only numbers of the form 6k ± 1). Whatever is left has no prime factor below 1,000. It is tested with a deterministic Miller–Rabin primality test (exact for every number in the supported range) and, if composite, split with Pollard's rho method, so even a 12-digit product of two large primes is factored almost instantly. The division ladder then lists the primes smallest first.

From the exponents you can read off more facts. The number of divisors is the product of (exponent + 1) over all primes, and the sum of divisors is the product of (p^(a+1) − 1)/(p − 1). A number is a perfect square exactly when every exponent is even.

n
The number being factored
pᵢ
Distinct prime factors in increasing order
aᵢ
How many times each prime divides n (its exponent)

Worked examples

Prime factors of 360

360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5, and 5 is prime. So 360 = 2³ × 3² × 5, which has (3+1)(2+1)(1+1) = 24 divisors.

Is 97 prime?

No prime up to √97 ≈ 9.8 (2, 3, 5 or 7) divides 97, so it is prime and its only divisors are 1 and 97.

A large number: 1,234,567,890

Dividing out 2, 3, 3 and 5 leaves 13,717,421, which splits into the primes 3,607 × 3,803. With exponents 1, 2, 1, 1, 1 the number has 2·3·2·2·2 = 48 divisors.

Frequently asked questions

What is prime factorization?+

It is writing a whole number as a product of prime numbers only. For example 84 = 2 × 2 × 3 × 7, or 2² × 3 × 7 in exponent form. Every number above 1 has exactly one such factorization.

How do you make a factor tree?+

Split the number into any two factors, then keep splitting each branch until every leaf is prime. The ladder method used here does the same thing by always dividing by the smallest prime that fits.

Is 1 a prime number?+

No. A prime has exactly two distinct divisors, 1 and itself, and 1 has only one. Excluding 1 is what keeps every factorization unique.

How is prime factorization used to find the GCF and LCM?+

Factor both numbers. The GCF multiplies the primes they share, each to the lower power; the LCM multiplies every prime that appears, each to the higher power. For 12 = 2²·3 and 18 = 2·3², the GCF is 6 and the LCM is 36.

How many divisors does a number have?+

Add 1 to each exponent in the prime factorization and multiply. 360 = 2³·3²·5 has (3+1)(2+1)(1+1) = 24 divisors.

Related tools