Prime Factorization Calculator
Enter a whole number to break it into prime factors. You get the factorization in exponent form, a factor tree, the division ladder, a prime-or-composite verdict and every divisor — for numbers up to 10²⁰, factored in a fraction of a second, entirely in your browser.
Any whole number from 2 up to 10²⁰.
Results
2³ × 3² × 5
Prime factorization
Composite
Prime or composite?
24
Number of divisors
3
Distinct prime factors
6
Prime factors, with repeats
360 = 2³ × 3² × 5
Written out: 2 × 2 × 2 × 3 × 3 × 5
Calculator form: 2^3 * 3^2 * 5
Factor tree
Each composite number splits into the factor pair closest to its square root. The circled numbers at the ends of the branches are the prime factors.
Division ladder
Divide by the smallest prime that goes in exactly, and repeat until the quotient is 1. The divisors you used are the prime factors.
360 ÷ 2 = 180
180 ÷ 2 = 90
90 ÷ 2 = 45
45 ÷ 3 = 15
15 ÷ 3 = 5
5 ÷ 5 = 1
Divisors
Add 1 to each exponent and multiply: (3 + 1)(2 + 1)(1 + 1) = 24. These are all of them:
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
How to Use the Prime Factorization Calculator
- 1. Enter a whole number. Anything from 2 up to 10²⁰ works; spaces between digit groups are ignored. A negative number is factored as −1 times its absolute value.
- 2. Read the factorization. The headline gives the exponent form, such as 2³ × 3² × 5, and below it the same product written out in full and in a form you can paste into a calculator or spreadsheet.
- 3. Follow the method you need. The factor tree shows how the number splits into smaller factors; the division ladder shows the same primes found by repeated division.
- 4. Use the divisors. The divisor count comes from the exponents, and when there are 240 or fewer every divisor is listed in order.
What Prime Factorization Means
A prime is a whole number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13 and so on. Every other whole number greater than 1 is composite — a product of smaller numbers — and the number 1 is neither. The fundamental theorem of arithmetic says that every whole number greater than 1 can be written as a product of primes in exactly one way, apart from the order of the factors. That product is its prime factorization, and it works like a fingerprint: 360 is 2³ × 3² × 5 and nothing else is.
To test a number for primality you only need to try prime divisors up to its square root, because any factor larger than √n must pair with one smaller than √n. For 391, √391 ≈ 19.8, so testing 2, 3, 5, 7, 11, 13, 17 and 19 is enough — and 17 divides it: 391 = 17 × 23.
Worked Example: 360
Factor tree. The calculator splits each composite number into the factor pair closest to its square root, which keeps the tree short and wide. 360 splits into 18 × 20; 18 into 3 × 6 and 6 into 2 × 3; 20 into 4 × 5 and 4 into 2 × 2. The ends of the branches — 3, 2, 3, 2, 2 and 5 — are the primes. Any other first split, such as 10 × 36, reaches the same six primes.
Division ladder
360 ÷ 2 = 180 180 ÷ 2 = 90 90 ÷ 2 = 45 45 ÷ 3 = 15 15 ÷ 3 = 5 5 ÷ 5 = 1
Three 2s, two 3s and one 5 give 360 = 2³ × 3² × 5. The exponents also count the divisors: every divisor uses 2 between zero and three times, 3 between zero and two times, and 5 zero or one time, so there are (3 + 1)(2 + 1)(1 + 1) = 24 divisors, from 1, 2, 3, 4 and 5 up to 180 and 360.
How Large Numbers Are Factored
Up to 10¹² the calculator uses trial division on a 6k ± 1 wheel: after 2 and 3 it only tries numbers of the form 6k − 1 and 6k + 1, which skips two-thirds of the candidates. Beyond that, small factors are removed the same way, the remainder is tested with the Miller–Rabin primality test — using twelve fixed bases that make it exact for every number this tool accepts — and a composite remainder is split with Pollard's rho algorithm. The hardest case, a product of two ten-digit primes, takes a few dozen milliseconds.
Why factoring is hard
Multiplying two primes is instant; recovering them from the product is not. RSA encryption relies on exactly that gap, with primes hundreds of digits long — far beyond what any calculator, this one included, can factor.
Frequently Asked Questions
- Is 1 a prime number?
- No. A prime must have exactly two divisors, 1 and itself, and 1 has only one. Excluding it is also what keeps prime factorizations unique — if 1 counted, 6 could be written as 2 × 3, 1 × 2 × 3, 1 × 1 × 2 × 3, and so on.
- What is the prime factorization of 100?
- 100 = 2² × 5², or 2 × 2 × 5 × 5 written out. It has (2 + 1)(2 + 1) = 9 divisors: 1, 2, 4, 5, 10, 20, 25, 50 and 100.
- Can different factor trees give different answers?
- The trees can look different, but the primes at the ends of the branches are always the same. 360 can start as 18 × 20, 10 × 36 or 2 × 180, and every version ends with three 2s, two 3s and one 5.
- When do I stop dividing?
- Stop when the quotient is 1 — every factor used along the way is a prime factor. If you are testing whether a number is prime, you can stop once the next prime to try is larger than the square root of what is left: the remainder is then prime itself.
- What is prime factorization used for?
- It gives the greatest common factor and least common multiple of numbers, simplifies fractions and square roots (√72 = √(2³ × 3²) = 6√2), counts divisors, and underlies public-key cryptography such as RSA.
- How many divisors does a number have?
- Add 1 to each exponent in the prime factorization and multiply. For 2³ × 3² × 5 that is 4 × 3 × 2 = 24. A prime always has exactly 2 divisors, and a perfect square always has an odd number of them.