Prime Factorization Calculator
Enter any whole number to break it down into its prime factors, see a step-by-step factor tree, and list every divisor it has. This is the same underlying math used by the LCM and GCF calculator, and it shows up again once you start counting arrangements with the permutations and combinations calculator.
Prime Factorization
Is It Prime?
Total Divisors
Perfect Square?
Factor Tree
All Divisors
What Is Prime Factorization?
Prime factorization is the process of breaking a number down into the set of prime numbers that multiply together to produce it. A prime number is any whole number greater than 1 that has no divisors other than 1 and itself (2, 3, 5, 7, 11, 13...). Every other whole number greater than 1 is called composite, meaning it can be built from smaller prime factors.
For example, 360 can be broken down into 2 × 2 × 2 × 3 × 3 × 5. Written in exponent form, that's 360 = 2³ × 3² × 5. No matter which order you divide the factors out in, you always end up with the exact same set of primes — that's what makes prime factorization so useful for comparing numbers.
How to Find Prime Factorization by Hand (Trial Division)
The most reliable manual method is trial division: repeatedly divide by the smallest prime that fits, and keep going until only 1 is left.
Step 1 — Divide by 2 as many times as possible
Check if the number is even. If it is, divide by 2 and repeat. For 360: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45. 45 is odd, so we move on. That's three 2's so far: 2³.
Step 2 — Divide by 3 as many times as possible
45 ÷ 3 = 15, 15 ÷ 3 = 5. 5 is not divisible by 3, so we stop. That's two 3's: 3².
Step 3 — Continue with 5, 7, 11, and so on
5 is itself prime, so 5 ÷ 5 = 1 and we're done. Putting it all together: 360 = 2³ × 3² × 5. You only ever need to test divisors up to the square root of the number that's left — if nothing up to that point divides evenly, the remaining number is prime.
What Is a Factor Tree?
A factor tree is the visual version of the same idea, and it's the way most students first learn prime factorization in school. You start with the original number at the top, then draw two branches down to any pair of factors that multiply back to it. Whichever branches land on a prime number stop there (that's a "leaf"), and any branch that lands on a composite number keeps splitting into two more factors. Once every branch ends in a prime, you're finished — the tree's leaves, read together, are the number's full prime factorization.
There's no single "correct" tree for a number since you can start by splitting it into different factor pairs, but every valid tree for the same starting number will always end with the same set of prime leaves. The tree above splits each composite branch at a fairly balanced point to keep the diagram short and readable.
Frequently Asked Questions
Is 1 a prime number? Why not?
No. A prime number is defined as having exactly two positive divisors: 1 and itself. The number 1 only has one divisor (itself), so it fails that definition. Mathematicians classify 1 as neither prime nor composite — it's simply its own special case, sometimes called a "unit."
What is the fastest way to check if a large number is prime?
For numbers you can factor by hand, trial division up to the square root of the number is usually fast enough — you only need to test potential divisors up to √n, since any factor larger than that would have to be paired with a factor smaller than √n. For truly enormous numbers (hundreds of digits), computers use much faster probabilistic tests like the Miller–Rabin primality test rather than trial division, since checking every possible divisor would take far too long.
How is prime factorization used in real life?
It shows up constantly in everyday math: simplifying fractions to lowest terms, and finding the LCM and GCF of two or more numbers both rely on comparing prime factorizations directly. It also underpins modern cybersecurity — RSA encryption, which secures much of the internet, works by multiplying two huge prime numbers together to create a key. Multiplying them is easy, but factoring that giant product back apart without already knowing the primes is so slow that it keeps the encryption secure.
What's the difference between a factor and a prime factor?
A factor (or divisor) of a number is any whole number that divides it evenly, prime or not. A prime factor is a factor that is also a prime number. For example, 360 has 24 total factors (1, 2, 3, 4, 5, 6, ...), but only three of them are prime factors: 2, 3, and 5. Every composite factor of 360 (like 4, 6, or 12) can itself be broken back down into some combination of those same three primes.
Can every number be broken down into primes?
Yes — this is the Fundamental Theorem of Arithmetic. In plain language, it says that every whole number greater than 1 has exactly one prime factorization, aside from the order you write the factors in. There's no other combination of primes that multiplies to the same number. That uniqueness is exactly why prime factorization is such a reliable tool for comparing, simplifying, and combining numbers.