Prime Factorization Calculator
Type a whole number of 2 or more. You get its prime factors in exponent form, a factor tree and the repeated division steps.
https://flxcode.com/prime-factorization-calculator/
Example
360 = 2 × 2 × 2 × 3 × 3 × 5.
Ways to write it
- Exponent form: 2³ × 3² × 5
- Every prime: 2 × 2 × 2 × 3 × 3 × 5
- 3 different primes, 6 in all.
Factor tree
Divide by the smallest prime each time
- 360 ÷ 2 = 180
- 180 ÷ 2 = 90
- 90 ÷ 2 = 45
- 45 ÷ 3 = 15
- 15 ÷ 3 = 5
- 5 ÷ 5 = 1
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Worked examples
| Number | Exponent form | Note |
|---|---|---|
| 360 | 2³ × 3² × 5 | The default: 2³ × 3² × 5 |
| 84 | 2² × 3 × 7 | Three different primes |
| 1001 | 7 × 11 × 13 | 7 × 11 × 13, a famous product |
| 1024 | 2¹⁰ | A power of 2 |
| 2310 | 2 × 3 × 5 × 7 × 11 | The product of the first five primes |
| 600851475143 | 71 × 839 × 1471 × 6857 | Project Euler problem 3: the largest prime factor is 6857 |
The method the tool follows
- Divide by 2 as many times as it goes. Each time, record a 2.
- Do the same for 3, then 5, 7, 11 and so on, skipping numbers that cannot be prime.
- Stop when the prime squared is bigger than what is left. What remains is itself prime.
For a 15-digit number the largest test prime is about 31.6 million, which a browser gets through in well under a second.
What you can do with it
- Count factors: add 1 to each exponent and multiply. 360 has 4 × 3 × 2 = 24. The factor calculator lists them.
- Find the GCF: lowest exponent of each shared prime. See the GCF calculator.
- Find the LCM: highest exponent of each prime. See the LCM calculator.
- Check for perfect squares and cubes: all exponents even means a square, all multiples of 3 means a cube.
- Simplify square roots: 360 = 2³ × 3² × 5, so the square root of 360 is 2 × 3 × the square root of 10.
Reading the tree
The top box is your number. Each step splits it into a prime (the round box on the left) and the rest (the box below it). The last split gives two primes. Reading all the round boxes gives the factorization. Very long trees are cut after 14 splits, and the exponent form always covers the whole number.
Numbers this uses
- Range: 2 to 1,000,000,000,000,000 (1e15). 1 has no prime factors. Larger numbers get "too large to factor here".
- Method: trial division by 2, 3 and then numbers of the form 6k ± 1, on exact integers, with a time cap of 1.5 seconds.
- Powers in exponent form use the superscript digits ² ³ ⁴ and up.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
What is prime factorization?
Writing a number as a product of primes. 360 = 2 × 2 × 2 × 3 × 3 × 5. By the fundamental theorem of arithmetic, every whole number above 1 has exactly one such product, apart from the order.
What is exponent form?
The same product with repeated primes grouped: 2³ × 3² × 5 instead of 2 × 2 × 2 × 3 × 3 × 5. It is shorter and it is what the GCF, LCM and factor-counting rules use.
How do I make a factor tree?
Split the number into any two factors, then split every composite factor again, until all the branches end in primes. This tool always splits off the smallest prime, so the tree is a spine with a prime on every level. The result is the same whichever way you split.
How do I do it by repeated division?
Divide by the smallest prime that fits (2, then 3, then 5, and so on) and repeat on the quotient until you reach 1. The divisors are the prime factors. The steps list under the tree shows 360 ÷ 2 = 180, 180 ÷ 2 = 90, and so on.
How do I tell if a number is prime?
If the factorization is the number itself, it is prime. The tool shows "is prime" then. A number is prime when no prime up to its square root divides it. 97 is prime, 91 is 7 × 13.
Why is 1 not shown with prime factors?
1 has no prime factors and is not prime itself. The tool asks for 2 or more. If 1 counted as prime, the factorization would not be unique: 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3.
How big a number can it handle?
Up to 1,000,000,000,000,000 (1e15), by trial division with a time cap of 1.5 seconds. The cost grows with the square root of the largest prime factor, so 15-digit primes take the longest. Beyond 1e15 the page says it is too large.
Is the number I type saved or sent?
No. The factorization runs in your browser. What you type is not put in the address bar, not stored and not counted. We only count whether a number was prime or composite.
More from FLXCode
Factor CalculatorNew
All factors and factor pairs of a number, and whether it is prime. Works up to 1e15.
GCF CalculatorNew
Greatest common factor of two or more numbers, with Euclid’s steps and the prime factor method.
LCM CalculatorNew
Least common multiple of two or more numbers, with the prime factor method, the GCF formula and a list of multiples.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.