Prime Factorization Calculator

Break any number up to 10^14 into primes with superscript products, divisor counts and lists, a primality badge, and a step-by-step division ladder.

All factorization happens locally in your browser. Nothing ever leaves your device.

—
Divisor count
—
Divisors
—

How It Works

The tool runs trial division with a small wheel: it divides out 2 and 3, then tries candidates in pairs 6k−1, 6k+1, which skips every multiple of 2 and 3 — two-thirds of all integers never get tested. Division continues while the squared candidate does not exceed the shrinking remainder, so the loop ends after at most about 10^6 to 10^7 steps for numbers up to 10^14. Whatever remainder survives that final square-root test is prime by construction, which makes the primality badge a proof rather than a heuristic.

Why stopping at the square root is enough
Divisors come in pairs: if n = a × b, one of the two factors is at most √n. So if no prime up to √n divides n, n has no factorisation at all and must itself be prime. For 360 the trials stop at √360 ≈ 19, and after dividing out 2³×3²×5 the remainder is 1 — done.
The 6k±1 wheel
Every prime greater than 3 sits next to a multiple of 6, because 6k, 6k+2 and 6k+4 are even and 6k+3 is a multiple of 3. Testing only 5, 7, 11, 13, 17, 19, ... instead of 4, 5, 6, 7, 8, ... cuts the candidate list to a third with zero risk of missing a factor.
Trial division vs the Sieve of Eratosthenes
A sieve is the right tool when you want every prime up to some limit; for one number's factorization it wastes memory on primes you never test. Trial division walks the factors directly — and the Steps ladder shows exactly which divisions succeeded, something a sieve bitmap cannot.

Frequently Asked Questions

Is 1 a prime number?

No, and it is not just a convention for pedants. The fundamental theorem of arithmetic says every integer greater than 1 factors into primes in exactly one way; if 1 were prime, 12 would factor as 2×2×3, or 1×2×2×3, or 1×1×2×2×3, and uniqueness would die. Primes are also defined as having exactly two distinct divisors — 1 has only one. This calculator rejects 1 and 0 as factorization inputs for that reason.

How does trial division prove what it claims?

The tool divides out 2, then 3, then every candidate of the form 6k±1 up to the square root of the shrinking remainder. If nothing divides the remainder when the trial exceeds its square root, that remainder must be prime — a composite always has a factor at or below its square root. So inside the 10^14 ceiling every answer, including the primality badge, is a proof, not a guess.

What about numbers bigger than the input ceiling?

Above 10^14 trial division gets slow, and proper tools switch tactics: Fermat tests, Miller-Rabin probabilistic tests, or ECPP proofs for certifying primality. Those answer 'is this prime?' but not 'what are its factors' — factoring a 20-digit semiprime can take hours even on good hardware. This calculator deliberately stops where plain browser trial division stays instant and honest instead of pretending to continue.

What is a perfect number, since the divisor list is right here?

One equal to the sum of its proper divisors: 28 = 1+2+4+7+14. The divisor list under each result makes them easy to spot; the next ones are 496, 8128, and 33550336. Euclid proved that every number of the form 2^(p-1)(2^p - 1), with 2^p - 1 prime, is perfect — nobody knows whether an odd perfect number exists, in over 300 years of looking.

Is anything uploaded to a server?

No. Trial division, divisor generation, and the batch table all run in your browser with plain JavaScript. Your numbers never leave your device, and there is no account or network request attached to a factorization.