Prime Factorization Calculator

Break any integer up to a trillion into primes — with exponents, every division step, and a primality verdict.

How to use the prime factorization calculator

  1. Type an integer from 2 to 1,000,000,000,000. Whole numbers only — no decimals.
  2. Press Factor it. The factorization with exponents appears instantly, even near a trillion.
  3. Read the division steps. Each line is one split the calculator tried — copy them straight into your working.
  4. Check the counts. “With multiplicity” counts repeats (2, 2, 2, 3, 3); “distinct” counts each prime once.
  5. Try a big prime. Enter 999999999989 and watch it confirm primality in a blink — that’s the square-root shortcut at work.

Frequently asked questions

What is prime factorization?

Writing a number as a product of prime numbers — numbers divisible only by 1 and themselves. Every integer above 1 has exactly one prime factorization (ignoring order); for example, 72 = 2³ × 3².

How does the calculator factor numbers so fast?

It uses trial division with a 6k ± 1 wheel: after checking 2 and 3, it only tests divisors of the form 6k − 1 or 6k + 1 (5, 7, 11, 13, …), skipping every multiple of 2 or 3. That cuts the work by two-thirds and factors anything up to a trillion in a fraction of a second.

How do you know if a number is prime?

If trial division finds no divisor up to the square root, the number must be prime — any composite number has a factor no bigger than its square root. When that happens, the factorization is just the number itself.

What does “with multiplicity” mean?

Counting each prime factor as many times as it appears. 72 = 2³ × 3² has 5 prime factors with multiplicity (2, 2, 2, 3, 3) but only 2 distinct prime factors.

Why can’t I factor 1 or 0?

1 is neither prime nor composite — it has no prime factors at all, so there’s nothing to show. 0 is divisible by every prime infinitely, so its factorization is undefined. The calculator starts at 2, the smallest prime.

More from the codex

Questions or feedback?

Found a bug or want a feature? Email [email protected] — every message is read by the indie dev behind the codex.