Free prime factorization calculator
Find the prime factorization of any number — enter a whole number to see it broken into its prime factors, updated live, as you type.
On this page10 sections
Trial division method. Based on the Fundamental Theorem of Arithmetic (Euclid, Elements VII.31): every integer > 1 has a unique prime factorization.
Results are estimates. Consult a professional.
How the prime factorization calculator works
Prime factorization expresses any integer greater than 1 as a product of prime numbers. The algorithm repeatedly divides the number by the smallest prime that divides it evenly, starting with 2, until the quotient reaches 1. The result is written as a product of prime powers.
Worked example: factorising 360 and 84
Divide repeatedly by the smallest prime at each step. 360: 360÷2=180, 180÷2=90, 90÷2=45, 45÷3=15, 15÷3=5, 5÷5=1. 84: 84÷2=42, 42÷2=21, 21÷3=7, 7÷7=1.
Prime factorizations of 2–30
Every composite number in the table below can be built from the primes listed. Prime numbers appear with only themselves as factors.
| Number | Prime factorization | Number | Prime factorization |
|---|---|---|---|
| 2 | 2 (prime) | 17 | 17 (prime) |
| 3 | 3 (prime) | 18 | 2 × 3² |
| 4 | 2² | 19 | 19 (prime) |
| 5 | 5 (prime) | 20 | 2² × 5 |
| 6 | 2 × 3 | 21 | 3 × 7 |
| 7 | 7 (prime) | 22 | 2 × 11 |
| 8 | 2³ | 23 | 23 (prime) |
| 9 | 3² | 24 | 2³ × 3 |
| 10 | 2 × 5 | 25 | 5² |
| 11 | 11 (prime) | 26 | 2 × 13 |
| 12 | 2² × 3 | 27 | 3³ |
| 13 | 13 (prime) | 28 | 2² × 7 |
| 14 | 2 × 7 | 29 | 29 (prime) |
| 15 | 3 × 5 | 30 | 2 × 3 × 5 |
| 16 | 2⁴ |
Source: computed by trial division; primes sourced from the Sieve of Eratosthenes
Tips for prime factorization
Prime factorization is a foundational skill for simplifying fractions, finding GCF/LCM, and working with square roots. These shortcuts will speed up manual work.
- Use divisibility rules first — even → divisible by 2; digit sum divisible by 3 → divisible by 3; ends in 0 or 5 → divisible by 5.
- You only need to test primes up to √n — if no prime ≤ √n divides n, then n is prime (e.g. to test 97, only check 2, 3, 5, 7).
- A factor tree is a visual alternative — split any composite into two factors, then keep splitting each branch until every node is prime.
- Prime factorization simplifies square roots — √72 = √(2³×3²) = √(4×9×2) = 6√2; group prime pairs under the radical.
- LCM and GCF in one step — once you have prime factorizations of two numbers, GCF = product of shared primes (min exponents) and LCM = product of all primes (max exponents).
Accuracy and limitations
Trial division, the method used here, is exact for all integers. It is efficient for numbers up to roughly 10¹² on modern hardware. For very large numbers (15+ digits), trial division becomes slow; the calculator switches to a Miller-Rabin primality test combined with Pollard's rho algorithm for faster factorisation. Inputs must be positive integers greater than 1. The number 1 has no prime factors by convention, and 0 is undefined.
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.