Prime Factorization Calculator

Decompose any integer into its prime factors — and find GCF and LCM for any two numbers.

🔢 Prime Factorization Calculator
Enter a whole number (2 to 10,000,000)
GCF & LCM Calculator
First Number
Second Number

🔢 What is Prime Factorization?

Prime factorization is the process of breaking down a positive integer into a product of prime numbers. A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself. The primes begin: 2, 3, 5, 7, 11, 13, 17, 19, 23, … The Fundamental Theorem of Arithmetic guarantees that every integer greater than 1 has a unique prime factorization — there is exactly one way to write any number as a product of primes (ignoring order).

For example, 360 = 23 × 32 × 5. This means 360 = 8 × 9 × 5. The exponents tell you how many times each prime divides the number. No matter which method you use to find it, you always arrive at the same answer — this uniqueness is fundamental to number theory and cryptography.

The number of divisors of a number follows directly from its prime factorization. If n = p1e1 × p2e2 × …, then the count of divisors = (e1+1)(e2+1)… — multiply each exponent-plus-one together. For 360: (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24 divisors. This is why highly composite numbers (like 360, used in angle measurement) have so many convenient factors.

Prime factorization also provides the most efficient method to find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of two numbers. GCF uses the lower exponent for shared primes; LCM uses the higher exponent for all primes. These operations are essential in simplifying fractions, solving equations, scheduling repeating events, and countless other mathematical tasks.

📐 Formula

n = p1e1 × p2e2 × … × pkek
pi = distinct prime factors of n (2, 3, 5, 7, …)
ei = exponent (how many times pi divides n)
Number of divisors = (e1+1)(e2+1)…(ek+1)
Example: 360 = 23 × 32 × 5 → divisors = (3+1)(2+1)(1+1) = 24
GCF(a, b) = product of shared primes with lower exponents
Example: GCF(12, 18): 12=22×3, 18=2×32 → GCF = 21×31 = 6
LCM(a, b) = product of all primes with higher exponents
Example: LCM(12, 18): 12=22×3, 18=2×32 → LCM = 22×32 = 4×9 = 36
Key relationship: GCF(a,b) × LCM(a,b) = a × b

📖 How to Use This Calculator

Steps to Find Prime Factorization

1
Enter a whole number between 2 and 10,000,000 in the input field. The default value 360 demonstrates a number with multiple prime factors.
2
Click Factorize to see the complete prime factorization in exponential notation, the number of prime factors, whether the number is prime, and a step-by-step division table.
3
For GCF & LCM, scroll to the second calculator, enter two numbers, and click Find GCF & LCM to see both values alongside the prime factorizations of each number.

💡 Example Calculations

Example 1 — Prime Factorization of 360

Factor 360 into primes

1
360 ÷ 2 = 180  ·  180 ÷ 2 = 90  ·  90 ÷ 2 = 45
2
45 ÷ 3 = 15  ·  15 ÷ 3 = 5  ·  5 is prime
3
360 = 23 × 32 × 5  ·  Divisors = (3+1)(2+1)(1+1) = 24
360 = 2³ × 3² × 5 — Composite — 24 divisors
Try this example →

Example 2 — Is 97 Prime?

Check whether 97 is prime

1
Test divisibility by primes up to √97 ≈ 9.8: check 2, 3, 5, 7
2
97 ÷ 2 = 48.5 ✗  ·  97 ÷ 3 = 32.3 ✗  ·  97 ÷ 5 = 19.4 ✗  ·  97 ÷ 7 = 13.9 ✗
3
No prime up to √97 divides 97, so 97 is prime.
97 = 97 (prime itself) — Yes — prime! — 2 divisors (1 and 97)
Try this example →

Example 3 — GCF and LCM of 12 and 18

Find GCF and LCM of 12 and 18

1
12 = 22 × 3  ·  18 = 2 × 32
2
GCF: shared primes with lower exponent → 21 × 31 = 6
3
LCM: all primes with higher exponent → 22 × 32 = 4 × 9 = 36
GCF(12, 18) = 6  ·  LCM(12, 18) = 36  ·  Check: 6 × 36 = 216 = 12 × 18 ✓

Example 4 — A Large Composite Number

Factorize 1,000,000

1
1,000,000 = 106 = (2 × 5)6
2
1,000,000 = 26 × 56
3
Divisors = (6+1)(6+1) = 7 × 7 = 49 divisors
1,000,000 = 2⁶ × 5⁶ — Composite — 49 divisors
Try this example →

❓ Frequently Asked Questions

What is prime factorization?+
Prime factorization expresses a positive integer as a product of prime numbers. Every integer > 1 has exactly one prime factorization (Fundamental Theorem of Arithmetic). Example: 360 = 2³ × 3² × 5. The primes 2, 3, and 5 are the only prime building blocks of 360, appearing 3, 2, and 1 times respectively.
How do you find prime factorization step by step?+
Use trial division: (1) Start dividing by 2 — if it divides, record it and continue with the quotient. (2) Move to 3, then 5, then 7, etc. Only test primes up to √n. (3) When the quotient becomes 1, stop. Example for 180: 180÷2=90, 90÷2=45, 45÷3=15, 15÷3=5, 5 is prime. Result: 180 = 2² × 3² × 5.
What is the prime factorization of 360?+
360 = 2³ × 3² × 5. Division steps: 360÷2=180, 180÷2=90, 90÷2=45, 45÷3=15, 15÷3=5, 5 is prime. The number 360 has (3+1)(2+1)(1+1) = 24 divisors, which is why it was chosen by ancient Babylonians for angle measurement — 360 degrees divides evenly into 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180 parts.
How do you find GCF and LCM using prime factorization?+
GCF: factorize both numbers, take shared prime factors with the LOWER exponent. LCM: take all prime factors with the HIGHER exponent. Example: GCF(12,18): 12=2²×3, 18=2×3² → GCF = 2¹×3¹ = 6. LCM = 2²×3² = 36. Shortcut: LCM = a×b/GCF = 12×18/6 = 36.
How many divisors does a number have?+
If n = p₁^e₁ × p₂^e₂ × ... × pₖ^eₖ, then divisors count = (e₁+1)(e₂+1)...(eₖ+1). Example: 360 = 2³×3²×5¹ → (3+1)(2+1)(1+1) = 24. For a prime p: p = p¹ → (1+1) = 2 divisors (1 and p). For a prime squared p²: (2+1) = 3 divisors (1, p, p²).
Is 1 a prime number?+
No. 1 is neither prime nor composite. By definition, primes have exactly two distinct factors (1 and themselves), but 1 has only one factor. Excluding 1 from primes preserves the Fundamental Theorem of Arithmetic's uniqueness — if 1 were prime, then 6 could be written as 2×3 or 1×2×3 or 1×1×2×3, losing unique factorization.
What is the Fundamental Theorem of Arithmetic?+
Every integer greater than 1 is either prime or can be expressed as a unique product of primes (up to reordering). This theorem has two parts: existence (every integer has at least one prime factorization) and uniqueness (there is exactly one such factorization). It is the foundation of number theory and makes GCF, LCM, and divisor counting well-defined operations.
What is the largest prime factor of 100?+
100 = 2² × 5². The prime factors are 2 and 5. The largest prime factor of 100 is 5. For comparison: the largest prime factor of 99 (= 3² × 11) is 11, and 101 is itself prime. The largest prime factor grows slowly: for n = 1000, it is 5 (since 1000 = 2³×5³).
How is prime factorization used in cryptography?+
RSA encryption secures internet transactions using the fact that multiplying two large primes (e.g., 1024-bit primes) is fast, but factoring their product back into the original primes is computationally infeasible with current technology. Your bank uses prime factorization's hardness every time you make an online payment — the encryption key is a product of two secret primes.
How do I find GCF without prime factorization?+
Use the Euclidean algorithm: repeatedly divide the larger by the smaller, keeping only the remainder, until the remainder is 0. The last non-zero remainder is the GCF. Example: GCF(48, 18): 48 = 2×18+12 → 18 = 1×12+6 → 12 = 2×6+0. GCF = 6. This is faster than factorization for very large numbers.