Prime Factorization
Break any whole number down into its prime factors, shown in exponent form and as a full list, with the divisor count and sum of divisors. Free, instant and private — the math runs entirely in your browser.
Whole numbers from 2 up to 20 digits. Commas and spaces are ignored, so you can paste 1,000,000.
Exponent form
Expanded form
How to use the prime factorization calculator
- Enter a number. Type any whole number from 2 up to 20 digits — thousands separators like commas or spaces are stripped automatically.
- Read the factorization. The result appears instantly in exponent form (5040 = 24 × 32 × 5 × 7) and as an expanded list of every prime factor.
- Use the extras. The divisor count and sum of divisors are computed from the factorization, and one click copies the whole thing as plain text.
About this tool
Every integer greater than 1 can be written as a product of primes in exactly one way — that is the fundamental theorem of arithmetic, and it is what this prime factorization calculator computes. Small factors are found with trial division; anything that survives is split with Pollard's rho algorithm, with each piece verified prime by the deterministic Miller–Rabin test, so even 20-digit numbers factor in well under a second with exact big-integer arithmetic. If your number turns out to be prime itself, the tool says so — you can double-check any candidate with the prime number checker.
Prime factorizations are the backbone of simplifying fractions and radicals, finding GCDs and LCMs by hand, counting divisors, and understanding RSA-style cryptography. As with every tool on this site, the computation happens locally in your browser: the numbers you factor are never uploaded, stored or logged.
Frequently asked questions
What is prime factorization?
It is the unique way of writing a number as a product of prime numbers. For example 360 = 2³ × 3² × 5. The primes are the "atoms" of multiplication: every whole number greater than 1 is built from them in exactly one way, apart from the order of the factors.
How are the divisor count and sum calculated?
Both come straight from the exponents. If n = pa × qb, the number of divisors is (a+1)(b+1), and the sum of divisors is (1+p+…+pa)(1+q+…+qb). For 12 = 2² × 3 that gives 3 × 2 = 6 divisors summing to 7 × 4 = 28.
Which algorithm does the calculator use?
Trial division with a mod-30 wheel removes all prime factors up to 100,000; any remaining part is either proven prime with the deterministic Miller–Rabin test or split further with Pollard's rho (Brent's variant). This combination factors any number up to 20 digits almost instantly.
Why is the limit 20 digits?
Within 20 digits the Miller–Rabin witness set used here is mathematically proven to be exact, and Pollard's rho always finds the factors quickly. Beyond that, factoring can require serious computing time — a 60-digit "hard" semiprime would take even specialized software noticeable effort.