Prime Factorization Calculator

What are the prime factors of any positive integer?

Enter any positive integer and see its complete prime factorization. Shows all prime factors and their powers in both expanded and exponential form.

Updated June 2026 · How this works

Worth knowing
How It Works
The formula, explained simply

Prime factorization breaks any composite number down to its fundamental prime building blocks. This calculator uses trial division, the most reliable method for finding prime factors of any positive integer.

The process starts with the smallest prime number, 2. The calculator divides your input number by 2 repeatedly until it no longer divides evenly. Then it moves to the next prime (3), then 5, 7, 11, and continues this pattern. Each successful division adds that prime to the factorization list.

For efficiency, the calculator only tests potential divisors up to the square root of the remaining number. If no prime up to the square root divides the number, then the remaining number itself must be prime. This optimization dramatically speeds up factorization of larger numbers.

The result appears in two formats: expanded form shows every prime factor multiplied together (like 2 × 2 × 3 × 5), while exponential form groups repeated primes with powers (like 2² × 3 × 5). Both representations are mathematically equivalent and show the unique prime factorization guaranteed by the Fundamental Theorem of Arithmetic.

When To Use This
Right tool, right situation

Prime factorization is essential for finding the greatest common divisor (GCD) and least common multiple (LCM) of two or more numbers. Factor each number into primes, then compare the factorizations to identify shared factors or combine unique factors.

Cryptography relies heavily on prime factorization difficulty. RSA encryption uses the fact that multiplying two large primes is easy, but factoring their product back into the original primes is computationally hard for very large numbers.

In everyday math, prime factorization simplifies fraction operations. To add fractions with different denominators, factor each denominator to find the LCM efficiently. It also helps identify perfect squares, cubes, and other powers by examining the exponents in the prime factorization.

Common Mistakes
Why results sometimes look wrong

The most common mistake is confusing prime factorization with finding all factors. Prime factorization only breaks a number into prime components, while factor finding lists every number that divides evenly into the original. For 12, the prime factorization is 2² × 3, but all factors are 1, 2, 3, 4, 6, and 12.

Another frequent error is stopping the division process too early. You must continue dividing by each prime until it no longer works, then move to the next prime. Missing repeated factors leads to incomplete factorizations.

Some people try to use composite numbers as factors in prime factorization. Remember that only prime numbers (2, 3, 5, 7, 11, 13, ...) can appear in a true prime factorization. If you include 4, 6, 8, or 9, you haven't broken the number down to its fundamental components.

The Math
Worked examples and deeper derivation

The Fundamental Theorem of Arithmetic guarantees that every integer greater than 1 has exactly one unique prime factorization (ignoring the order of factors). This means 60 will always factor as 2² × 3 × 5, regardless of which method you use to find the factors.

Trial division works by testing each prime number as a potential factor. For a number n, you only need to test primes up to √n. If no prime up to the square root divides n, then n itself is prime. This is because any composite number must have at least one prime factor less than or equal to its square root.

The exponential notation in prime factorization uses powers to show repeated factors. When you see 2³, it means 2 × 2 × 2 = 8. The exponent tells you how many times that prime appears in the complete factorization. This compact form makes it easier to work with the factors in further calculations.

Small composite number
Number: 12
12 = 2 × 2 × 3 = 2² × 3, showing two distinct primes with different powers.
Three-digit number
Number: 180
180 = 2 × 2 × 3 × 3 × 5 = 2² × 3² × 5, revealing three distinct prime factors.
Prime number check
Number: 23
23 is prime, meaning it cannot be factored into smaller primes and is fundamental.

Common questions

How do I find prime factors of a large number?
Start dividing by the smallest prime (2) repeatedly until it no longer divides evenly. Then try the next prime (3), then 5, 7, 11, and so on. The prime factorization calculator automates this trial division method for any number up to millions.
What is the difference between prime factorization and regular factoring?
Prime factorization breaks a number down to its fundamental prime building blocks only. Regular factoring finds any factors, including composite numbers. For example, 12 has factors 1, 2, 3, 4, 6, 12, but its prime factorization is just 2² × 3.
Why do some numbers show as prime in the calculator?
Prime numbers like 2, 3, 5, 7, 11, 13, 17, 19, 23 cannot be broken down further because they have exactly two factors: 1 and themselves. The calculator identifies these and shows them as already in their simplest prime form.

Need something this doesn't cover?

Suggest a tool — we'll build it →