Prime Factorization Calculator
Our free prime factorization calculator breaks any whole number up to one trillion into its prime factors. See the exponent form, a step-by-step factor tree, the divisor count, and whether your number is prime โ with instant results as you type.
Enter your number
Your results
Factor tree steps
How to use this calculator
Type any whole number between 1 and 1,000,000,000,000 into the box above โ the results update instantly, no button press needed. The calculator shows the prime factorization in two forms: the full factor list (2 ร 2 ร 2 ร 3 ร 3 ร 5) and the compact exponent form (2ยณ ร 3ยฒ ร 5).
Below that you get a step-by-step factor tree showing every division, plus the number of divisors, the sum of divisors, and a verdict: is the number prime, composite, or (for 1) neither? Decimals, negative numbers, and numbers over one trillion are rejected with a clear error rather than a silent wrong answer.
How it works
The tool uses trial division: it tries dividing your number by 2, then 3, then every odd number after that. Whenever a divisor works, it records the step (for example, 360 = 2 ร 180) and keeps going on the remaining quotient. When the divisor exceeds the square root of the remaining value, whatever is left must be prime, so the search stops early โ this keeps even 12-digit numbers fast in your browser.
From the factor list it derives the exponent form by grouping repeated primes, the divisor count from the formula (eโ+1)(eโ+1)โฆ, and the divisor sum from the standard multiplicative formula. Multiplying all prime factors back together always reproduces the original number โ the calculator checks this internally on every run.
Note the difference: this page factors a single number into primes. If you need to compare two or more numbers โ their least common multiple or greatest common divisor โ use our LCM and GCD Calculator instead.
Frequently asked questions
What is prime factorization?
Prime factorization is the process of breaking a whole number down into the prime numbers that multiply together to make it. For example, 12 = 2 ร 2 ร 3, so the prime factors of 12 are 2 and 3. Every composite number has exactly one prime factorization (ignoring order), which is known as the Fundamental Theorem of Arithmetic.
How does this prime factorization calculator work?
It uses trial division: it repeatedly divides your number by the smallest prime divisor (starting with 2, then 3, 5, 7, and so on) until only prime factors remain. You see every division step, so it doubles as a factor tree you can follow line by line.
Is this the same as an LCM or GCD calculator?
No. This calculator breaks one number into its prime factors. An LCM/GCD calculator compares two or more numbers โ the least common multiple and greatest common divisor of the set. If you need those instead, try our LCM and GCD Calculator.
What is the largest number this calculator can factor?
This calculator accepts whole numbers from 1 to 1,000,000,000,000 (one trillion). Trial division stays fast in that range. If you enter a decimal, a negative number, or anything larger, it will show an error instead of guessing.
How do I read the exponent form, like 2ยณ ร 3ยฒ ร 5?
Each repeated prime is grouped with an exponent: 2ยณ means 2 ร 2 ร 2. So 2ยณ ร 3ยฒ ร 5 means (2 ร 2 ร 2) ร (3 ร 3) ร 5 = 360. Multiply the factors back together to check the factorization.