Category 9 — Cryptography / Security

Integer Factorization

Decompose integers into prime factors using trial division or Pollard's Rho algorithm.

How to use this tool

  1. Type an integer into the Number to Factor box, or tap a sample like 840, 104729 (prime), or 1234567890 to fill it in.
  2. Pick a method from the dropdown: Trial Division or Pollard's Rho.
  3. Click Factor (or press Enter) to run the factorization.
  4. Read the result — the expression shows the number written as its prime factors, and the stats show distinct and total factor counts, Prime vs Composite status, and compute time.
  5. Open the Steps panel to see how the algorithm found each factor.
  6. Click Copy to copy the full number = factors expression to your clipboard.

Why this tool is helpful

Study number theory

See the fundamental theorem of arithmetic in action: every integer greater than 1 factors uniquely into primes, and this tool shows that decomposition directly.

Understand RSA & public-key crypto

An RSA modulus is just the product of two large primes. Factoring that number breaks the key — which is exactly why factoring is considered hard.

Check primality fast

The Status stat reports Prime or Composite instantly, and the factorization itself is the proof of which one it is.

Compare two algorithms

Run the same number through Trial Division and Pollard's Rho to see how their step counts and compute times differ in practice.

Verify work by hand

Follow the Steps panel to reproduce a factorization yourself, or double-check answers when teaching or doing homework.

Stay private

Everything runs in your browser. Your numbers are never uploaded, logged, or sent to a server.

FAQ

What does this tool do?

It decomposes a whole number into its prime factors. For example, 840 becomes 2^3 × 3 × 5 × 7, and the result is shown both as an expression and as a set of stats.

What's the difference between trial division and Pollard's rho?

Trial Division tests every candidate divisor up to the square root of the number — simple and deterministic. Pollard's Rho is a randomized algorithm that finds a nontrivial factor much faster on average for numbers with small factors, using a pseudorandom sequence and gcd.

What happens with 0 and 1?

0 has no prime factors, and 1 is a unit rather than a prime (by definition). The tool reports each case explicitly instead of trying to factor them.

What numbers can I enter?

Non-negative integers only — digits 0–9. Negative numbers, decimal points, and non-numeric characters are ignored and will not produce a result.

Why does factoring large numbers matter for security?

RSA encryption relies on the fact that multiplying two large primes is easy but factoring the product back apart is extremely hard. This tool makes that one-way hardness tangible.

Can it factor arbitrarily large integers?

It uses JavaScript BigInt, so input size is not limited to 32 or 64 bits. However, both algorithms are still exponential for large semiprimes, so a number with two huge prime factors can be slow and may stall the page.

Does any of my input leave my browser?

Never. All computation happens locally in JavaScript. Your numbers are not sent to, stored on, or logged by any server.