What is prime factorization?

Prime factorization is writing a whole number as a product of prime numbers only: 360 = 2 × 2 × 2 × 3 × 3 × 5. A prime number has exactly two divisors, 1 and itself, so it cannot be split any further; factorization keeps splitting a composite number until nothing but primes remain. The fundamental theorem of arithmetic guarantees the result is unique - every whole number greater than 1 has exactly one prime factorization, apart from the order of the factors - which is why the ladder, the factor tree and any other correct method all agree.

A prime factorization calculator does that splitting for you and shows its working. This page gives you five views of the same answer: the division ladder (each division step), the factor tree in text form, the plain list of prime factors of a number, the exponential form such as 2³ × 3² × 5, and the total divisor count worked out from the exponents. If you searched for prime factorisation with the British s spelling, factor tree calculator or prime factors of a number, you are in the right place - the maths is identical under every spelling.

How this prime factorization calculator works

Quick answer: Type any whole number up to 999,999,999,999 and press Calculate. The calculator divides by the smallest prime that works, again and again (trial division), records every step in the ladder, groups the primes into exponential form, and counts the divisors from the exponents.

The engine uses exact integer arithmetic (JavaScript BigInt), never floating point, so every division is exact and the check product always rebuilds your number precisely. Trial division only needs to run up to the square root of what is left: once the trial divisor squared passes the remaining value, that remainder is itself prime. Divisors are tried in the order 2, 3, then the 6k ± 1 wheel (5, 7, 11, 13, 17, 19, ...), which skips multiples of 2 and 3. Special cases are handled honestly rather than forced into the pattern: 1 has no prime factors, 0 has no factorization at all, negative numbers are factored by absolute value with the sign carried in front, and prime inputs are reported as prime - their factorization is themselves.

The two methods: division ladder and factor tree

The division ladder (repeated division) always divides by the smallest prime that works. For 360: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, and 5 is prime, so you stop. Reading the divisors down the side gives 2, 2, 2, 3, 3, 5. The ladder is the tidiest method for larger numbers because there is never a choice to make.

The factor tree splits the number into any two factors and keeps splitting composite branches: 360 = 10 × 36, then 10 = 2 × 5 and 36 = 6 × 6, then each 6 = 2 × 3, leaving the leaves 2, 5, 2, 3, 2, 3 - the same primes in a different order. The tree is the clearer teaching picture; the text tree above splits by the smallest prime at each step so it matches the ladder line for line. Either way, sorting the leaves gives the canonical factorization.

NumberPrime factorsExponential formDivisor count
122 × 2 × 32² × 36
362 × 2 × 3 × 32² × 3²9
602 × 2 × 3 × 52² × 3 × 512
842 × 2 × 3 × 72² × 3 × 712
1002 × 2 × 5 × 52² × 5²9
3602 × 2 × 2 × 3 × 3 × 52³ × 3² × 524
7202 × 2 × 2 × 2 × 3 × 3 × 52⁴ × 3² × 530
10242 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 22¹⁰11

Every row of that table was produced by the calculator above, so you can reproduce each one exactly: type the number, and compare the ladder, the exponential form and the divisor count.

Worked examples: 360, 97 and 1024

360 - a typical composite. The ladder above gives 360 = 2 × 2 × 2 × 3 × 3 × 5. Grouping repeats gives the exponential form 2³ × 3² × 5. Check: 2³ = 8, 3² = 9, and 8 × 9 × 5 = 360. ✓

97 - a prime. The square root of 97 is just under 10, so only the primes 2, 3, 5 and 7 need testing. 97 is odd, its digits sum to 16 (not divisible by 3), it does not end in 0 or 5, and 7 × 13 = 91 while 7 × 14 = 98, so 7 does not divide it either. No divisor works, so 97 is prime and its prime factorization is simply 97, with divisor count 2.

1024 - a pure power of two. Halving ten times - 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 - gives 1024 = 2¹⁰. No other prime ever appears, and the divisor count is 10 + 1 = 11.

Exponential form and the divisor count

Quick answer: Exponential form groups repeated primes: 2 × 2 × 2 × 3 × 3 × 5 becomes 2³ × 3² × 5. To count divisors, add 1 to every exponent and multiply: (3 + 1)(2 + 1)(1 + 1) = 24 divisors for 360.

The divisor-count rule works because of how divisors are built. Every divisor of 360 = 2³ × 3² × 5¹ has the form 2a × 3b × 5c, where a can be 0, 1, 2 or 3 (four choices), b can be 0, 1 or 2 (three choices) and c can be 0 or 1 (two choices). Independent choices multiply: 4 × 3 × 2 = 24. That is why the formula adds 1 to each exponent - the +1 is the choice of using that prime zero times. A prime number p = p¹ gives (1 + 1) = 2 divisors, 1 and p itself, exactly as it should.

What prime factorization is used for

Greatest common factor and least common multiple. With both numbers in exponential form, the GCF takes each shared prime to the smaller exponent and the LCM takes every prime to the larger one: 360 = 2³ × 3² × 5 and 84 = 2² × 3 × 7 share GCF 2² × 3 = 12 and have LCM 2³ × 3² × 5 × 7 = 2520. Simplifying fractions is the same idea: factor numerator and denominator and cancel the shared primes. Square and cube roots read straight off the exponents - 360 is not a perfect square because its exponents are not all even, while 1024 = 2¹⁰ has square root 2⁵ = 32. And the divisor count itself answers contest and puzzle questions about how many factors a number has without listing them.

Common prime factorization mistakes

Stopping too early. A factor list containing 4, 6, 8, 9 or any other composite number is unfinished - every entry must be prime. Calling 1 prime. 1 is neither prime nor composite; including it would destroy the uniqueness of factorization, since 360 could then be 1 × 2³ × 3² × 5, 1² × 2³ × 3² × 5, and so on forever. Miscounting the divisor formula. The exponents get +1 before multiplying; using the bare exponents for 360 gives 3 × 2 × 1 = 6, not 24. Skipping the check. Multiplying the factors back takes seconds and catches almost every slip - if the product is not your starting number, the factorization is wrong.

Limits: trial division and very large numbers

Honest boundaries, stated plainly. Supported range: whole numbers from −999,999,999,999 to 999,999,999,999. Within that range trial division is effectively instant, because the trial divisors never need to pass 1,000,000. The method itself has a real ceiling: trial division slows down with the square root of the number, so very large primes and semiprimes - the hundreds-of-digits numbers that cryptography relies on being hard to factor - are out of scope for this tool and for this method generally; research systems factor such numbers with far heavier algorithms over weeks or months. Integers only: decimals and fractions have no prime factorization; factor a fraction's numerator and denominator separately instead. Nothing on this page is AI - it is exact trial division, and every step it took is shown above.

Sources and References

Every figure in this guide was calculated with this page's own method, so you can reproduce each one exactly by entering the same numbers above.