Prime Factorization Calculator
Break any number into its prime factors in exponent form
🔢 Enter a number
✨ Prime factorization
📊 Summary
🪜 Step by step (trial division)
Keep dividing by the smallest prime that fits, then move up. Each row shows one division.
| Step | Divide by (prime) | Quotient |
|---|---|---|
| 1 | 2 | 180 |
| 2 | 2 | 90 |
| 3 | 2 | 45 |
| 4 | 3 | 15 |
| 5 | 3 | 5 |
| 6 | 5 | 1 |
The factorization ends when the quotient reaches 1.
🔬 Exponent form
| Prime | Exponent | Value |
|---|---|---|
| 2 | 3 | 8 |
| 3 | 2 | 9 |
| 5 | 1 | 5 |
🧩 All factors of 360
Every positive whole number that divides 360 evenly (24 in total):
Every integer greater than 1 has exactly one prime factorization (the Fundamental Theorem of Arithmetic). Results use trial division and are exact for the integers supported above.
Last updated June 2026
Method: Trial division by primes up to the square root of the number, following the Fundamental Theorem of Arithmetic (every integer greater than 1 has a unique prime factorization). Results are exact, not estimates.
Included: The prime factorization in exponent form, a step-by-step division trace, the complete list of factors (divisors), the divisor count, and a prime/composite verdict.
Not included: Factoring of non-integers, negative numbers, or values beyond the exact-integer range. The number 1 and 0 have no prime factorization.
Prime factorization calculator: everything you need to know
Type a number like 360 and this prime factorization calculator instantly returns 23 × 32 × 5, the unique set of prime building blocks that multiply back to 360. It also lists every factor of the number, counts how many there are, and tells you whether the number is prime or composite. Below the result you get a step-by-step division trace, so it works as a learning tool, not just an answer machine.
What prime factorization means
A prime number is a whole number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13, and so on. A composite number can be broken down into smaller factors. Prime factorization is the process of writing any integer greater than 1 as a product of primes. The result is guaranteed to be unique by the Fundamental Theorem of Arithmetic - no matter how you split the number, you always arrive at the same prime factors.
N = p1a₁ × p2a₂ × … × pkaₖ Here each p is a distinct prime and each a is the exponent counting how many times that prime appears. For 360, that is 23 × 32 × 51.
A worked example: factoring 360
Watch the trial-division method in action:
- 360 ÷ 2 = 180
- 180 ÷ 2 = 90
- 90 ÷ 2 = 45 (2 no longer divides evenly, move to 3)
- 45 ÷ 3 = 15
- 15 ÷ 3 = 5 (3 no longer divides, move up)
- 5 ÷ 5 = 1 (quotient reaches 1 - done)
Collecting the divisors: 2 appeared three times, 3 appeared twice, and 5 once, giving 23 × 32 × 5 = 360.
How to use this calculator
- Enter a whole number of 2 or greater in the input box (or tap one of the example chips).
- Read the headline factorization in exponent form - the big number at the top is your answer.
- Check the prime/composite badge directly underneath to see whether the number is prime.
- Follow the step-by-step table to see exactly which prime divided at each stage.
- Scan the full list of factors at the bottom for every divisor of the number.
The result updates instantly as you type - there is no button to press. Decimals, fractions, and negative numbers are rejected with a friendly message, because prime factorization is only defined for positive integers.
Who this calculator is for
- Students checking homework on factors, factor trees, GCF, and LCM.
- Teachers and tutors who want a clean step-by-step example to walk through.
- Parents helping with middle-school or early high-school math.
- Programmers and puzzlers who need a quick factorization or a primality check.
- Anyone curious whether a number is prime or how it is built.
Key terms explained
- Prime number: an integer greater than 1 divisible only by 1 and itself (2, 3, 5, 7, 11…).
- Composite number: an integer greater than 1 that has factors besides 1 and itself.
- Factor (divisor): any whole number that divides the value with no remainder.
- Exponent form: grouping repeated primes as powers, e.g. 23 instead of 2 × 2 × 2.
- Factor tree: a diagram that repeatedly splits a number until every branch ends in a prime.
- Trial division: the method of testing small primes in turn to peel off factors.
More worked examples
Example 1 - a prime number (97): Trial division tries 2, 3, 5, and 7 (the primes up to √97 ≈ 9.8) and none divide evenly. With nothing left to divide, 97 is itself prime, so its factorization is just 97 and its only factors are 1 and 97.
Example 2 - a power of two (1,024): Dividing by 2 repeatedly gives 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 - ten divisions in all. So 1,024 = 210, a perfect example of a number with a single prime factor raised to a high power. It has 11 factors (the powers of 2 from 20 to 210).
Example 3 - a year (2,024): 2,024 ÷ 2 = 1,012, ÷ 2 = 506, ÷ 2 = 253; then 253 ÷ 11 = 23, and 23 is prime. So 2,024 = 23 × 11 × 23. Counting divisors: (3+1)(1+1)(1+1) = 16 factors.
Quick reference: factorizations of common numbers
A handy table of prime factorizations and factor counts for numbers people look up often:
| Number | Prime factorization | # of factors | Prime? |
|---|---|---|---|
| 12 | 2² × 3 | 6 | No |
| 36 | 2² × 3² | 9 | No |
| 60 | 2² × 3 × 5 | 12 | No |
| 97 | 97 | 2 | Yes |
| 100 | 2² × 5² | 9 | No |
| 120 | 2³ × 3 × 5 | 16 | No |
| 360 | 2³ × 3² × 5 | 24 | No |
| 1,000 | 2³ × 5³ | 16 | No |
| 1,024 | 2¹⁰ | 11 | No |
Counting factors from the factorization
You do not have to list divisors one by one to count them. Take each exponent, add 1, and multiply the results. For 360 = 23 × 32 × 51, the divisor count is (3+1) × (2+1) × (1+1) = 4 × 3 × 2 = 24. The calculator shows the full list so you can verify it, but the formula is the fast way to do it by hand.
Using prime factors for GCF and LCM
Prime factorization is the backbone of two common school tasks. For the greatest common factor (GCF) of two numbers, factor both and multiply each shared prime raised to its lowest power. For the least common multiple (LCM), take every prime that appears in either number raised to its highest power. For example, 12 = 22 × 3 and 18 = 2 × 32: the GCF is 2 × 3 = 6, and the LCM is 22 × 32 = 36.
Tips for factoring by hand
- Always start at 2. If the number is even, keep halving until it is odd.
- Use divisibility rules. A number is divisible by 3 if its digits sum to a multiple of 3, and by 5 if it ends in 0 or 5.
- Skip even divisors once you have removed all the 2s - only odd primes can remain.
- Stop at the square root. If no prime up to √N divides the leftover, the leftover is prime.
- Group repeats as exponents at the end to write the answer cleanly.
Related concepts
Prime factorization connects to many other topics. It underpins simplifying fractions (cancel shared prime factors), square roots (a perfect square has even exponents on every prime), exponents, and even cryptography, where the difficulty of factoring very large numbers keeps data secure. If you need a different operation, try the related calculators below - the Fraction, Square Root, and Exponent tools all build on the same ideas.
⚠️ Common mistakes & edge cases
Treating 1 as a prime factor
1 is neither prime nor composite, and it never belongs in a factorization - writing "1 × 2 × 3" adds nothing. The number 1 itself has no prime factorization at all.
Stopping with composite factors
Writing 36 = 4 × 9 is not finished, because 4 and 9 are not prime. Keep splitting until every factor is prime: 36 = 2² × 3². A factor tree must reach prime leaves on every branch.
Confusing prime factors with all factors
The prime factors of 12 are just 2 and 3. Its full list of factors is 1, 2, 3, 4, 6, 12. Make sure you answer the question that was actually asked - the two lists are different.
Forgetting the exponents
2 × 2 × 2 × 3 × 3 × 5 is correct but unwieldy. The standard answer groups repeats: 2³ × 3² × 5. Dropping an exponent (writing 2 × 3 × 5 for 360) gives the wrong number.
❓ Frequently asked questions
What is prime factorization?
Prime factorization is writing a whole number as a product of prime numbers - numbers greater than 1 whose only divisors are 1 and themselves. For example, 360 = 2 x 2 x 2 x 3 x 3 x 5, which is written in exponent form as 2^3 x 3^2 x 5. By the Fundamental Theorem of Arithmetic, every integer greater than 1 has exactly one prime factorization (apart from the order of the factors).
How does this calculator find the prime factors?
It uses trial division. It repeatedly divides the number by the smallest prime that fits - first 2 as many times as possible, then 3, 5, 7 and so on, testing only up to the square root of the remaining value. Whatever is left over after that is itself a prime. The calculator records each division so you can follow the work step by step.
What does exponent form mean?
Exponent form groups repeated prime factors using powers. Instead of 2 x 2 x 2 x 3 x 3 x 5, you write 2^3 x 3^2 x 5, where the small raised number (the exponent) counts how many times that prime appears. It is the compact, standard way mathematicians write a factorization.
Is 1 a prime number?
No. By definition a prime number has exactly two distinct divisors: 1 and itself. The number 1 has only one divisor, so it is neither prime nor composite, and it has no prime factorization. The smallest prime number is 2, which is also the only even prime.
What is the difference between prime factors and all factors?
Prime factors are only the prime building blocks (for 12 they are 2 and 3). All factors - also called divisors - are every whole number that divides the value evenly, including 1 and the number itself (for 12 they are 1, 2, 3, 4, 6 and 12). This calculator shows both: the prime factorization and the full list of divisors.
How is a factor tree related to this?
A factor tree is the visual version of the same process: you split the number into any two factors, then keep splitting each branch until every leaf is prime. No matter which splits you choose, the prime leaves are always the same set - that is the uniqueness guaranteed by the Fundamental Theorem of Arithmetic. This calculator produces that final prime set directly.
How do I count the total number of factors?
Take the exponents in the prime factorization, add 1 to each, and multiply them together. For 360 = 2^3 x 3^2 x 5^1 the exponents are 3, 2 and 1, so the number of divisors is (3+1) x (2+1) x (1+1) = 4 x 3 x 2 = 24. The calculator lists all 24 factors and confirms the count for you.
Can I use prime factorization to find the GCF and LCM?
Yes. To find the greatest common factor (GCF) of two numbers, take each shared prime to its lowest power and multiply. For the least common multiple (LCM), take every prime that appears in either number to its highest power. Factoring both numbers first makes both calculations straightforward.
Why does the calculator only test up to the square root?
If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root (because the two multiply back to the original). So once trial division passes the square root with nothing left to divide, whatever remains has to be prime. Stopping at the square root makes the method fast without missing anything.
Does this work for very large numbers?
It handles numbers up to about 9 quadrillion (the largest integer JavaScript represents exactly). Trial division is quick for numbers with small prime factors but slows down for very large primes or semiprimes, since it may test every odd number up to the square root. For typical homework and everyday numbers it returns results instantly.
💡 Good to know
Every number has exactly one prime factorization
This is the Fundamental Theorem of Arithmetic. However you build your factor tree, the prime factors you end up with are always the same - only the order can differ. That uniqueness is why prime factors are so useful for comparing numbers.
2 is the only even prime
Every other even number is divisible by 2, so it cannot be prime. That is why, after removing all the 2s, you only ever need to test odd numbers when factoring by hand.
Big numbers are hard to factor on purpose
Multiplying two large primes is easy, but reversing it - factoring the product back into those primes - is extremely slow. Modern encryption like RSA relies on exactly this asymmetry to keep data safe.
Related Calculators
Percentage Calculator
Solve any percentage problem - what is X% of Y and more
Fraction Calculator
Add, subtract, multiply and divide fractions
Scientific Calculator
A full scientific calculator with trig, logs and more
Average Calculator
Calculate the mean, median and mode of numbers
Square Root Calculator
Find the square root of any number
Exponent Calculator
Raise numbers to any power