Prime Factorization Calculator

Enter any positive integer up to 1,000,000 to find its complete prime factorization. Results include exponential notation (e.g., 2³ × 3² × 5), a step-by-step division ladder (factor tree), and bonus facts like whether the number is prime or a perfect square.

Enter any integer from 2 to 1,000,000
Enter a number above to find its prime factorization

How It Works

Prime factorization expresses any positive integer as a product of prime numbers.

Algorithm — Trial Division:
1. Start with the smallest prime, 2.
2. Divide the number by 2 as many times as possible, recording each division.
3. Move to the next prime (3, 5, 7, 11, …) and repeat.
4. Continue until the remaining quotient is 1.

Example: Factorize 360
360 ÷ 2 = 180
180 ÷ 2 = 90
90 ÷ 2 = 45
45 ÷ 3 = 15
15 ÷ 3 = 5
5 ÷ 5 = 1

Prime factors: 2, 2, 2, 3, 3, 5
Exponential form: 2³ × 3² × 5
Verification: 8 × 9 × 5 = 360 ✓

A number is prime if its only factors are 1 and itself — the factorization is just the number alone.
A number is a perfect square if all prime exponents are even.

Optimization: We only need to test divisors up to √n. If no prime up to √n divides n, then n itself is prime.

Frequently Asked Questions

What is a prime number?

A prime number is a positive integer greater than 1 that has no positive divisors other than 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23… Note that 2 is the only even prime.

What is a factor tree?

A factor tree is a diagram showing how a number is progressively divided into smaller factors until all factors are prime. This calculator shows the division ladder (sequential divisions), which is equivalent to a factor tree but in a linear format.

What is exponential (index) form?

Exponential form groups repeated prime factors using exponents. Instead of writing 2 × 2 × 2 × 3 × 3, write 2³ × 3². The exponent shows how many times that prime appears as a factor.

How can I tell if a number is a perfect square?

A number is a perfect square if and only if every prime factor appears an even number of times in its factorization. For example, 36 = 2² × 3² is a perfect square (√36 = 6). But 12 = 2² × 3 is not a perfect square because 3 appears once (odd exponent).

What is the maximum number I can enter?

This calculator handles numbers up to 1,000,000. Factorization is near-instant for all values in this range using trial division optimized to check only up to √n.