Prime Factorization Calculator
Break down any positive integer into its prime factors. Shows the complete prime factorization, the number of factors, and whether the number is prime.
Prime factorization breaks any integer into its prime building blocks. Every integer greater than 1 can be written uniquely as a product of prime numbers — this is the Fundamental Theorem of Arithmetic, one of the most beautiful results in mathematics. Knowing the prime factorization of a number tells you nearly everything about its arithmetic properties.
A **prime** is a natural number greater than 1 with no divisors other than 1 and itself: 2, 3, 5, 7, 11, 13, 17, ... Every other natural number is **composite** — built from smaller primes through multiplication. So 12 = 2 × 2 × 3 = 2² × 3 (prime factorization). 100 = 2² × 5². 360 = 2³ × 3² × 5.
Prime factorizations enable many useful calculations: - **GCF**: lowest powers of common primes. - **LCM**: highest powers of all primes appearing in either number. - **Divisor counting**: from the factorization. - **Reducing fractions**: divide numerator and denominator by GCF. - **Square roots of integers**: separate squared factors.
Finding prime factorizations is computationally easy for small numbers but provably hard for very large numbers — this hardness underlies RSA cryptography, the foundation of internet security. Computers can factor 50-digit numbers, but 1000-digit semiprimes are practically impossible — secret bank transactions stay secret.
Common applications: simplifying fractions, finding GCF/LCM, number theory, cryptography (RSA, primality tests), computer science (hash functions), and any context involving divisibility properties.
Inputs
Results
Prime Factorization
2 x 2 x 2 x 3 x 3 x 5
Exponent Form
2^3 x 3^2 x 5
Is Prime?
No
Total Number of Divisors
24
Formula
How to use this calculator
- Enter a positive integer ≥ 2.
- Calculator returns prime factorization (with exponents).
- For very large numbers: may be slow with simple algorithms.
- Use for: GCF, LCM, fraction simplification, divisor counting.
- Verify: multiply factors together to get original.
- For primes: factorization is the number itself.
Worked examples
Standard composite
**Scenario:** Factor 360. **Calculation:** 360 = 2³ × 3² × 5. Steps: 360/2 = 180, 180/2 = 90, 90/2 = 45, 45/3 = 15, 15/3 = 5, 5/5 = 1. **Result:** 2³ × 3² × 5. Number of divisors: (3+1)(2+1)(1+1) = 24. Sum of divisors: 1170. 360 is highly composite — many factors make it useful in calendar systems and rotation degrees.
Recognizing a prime
**Scenario:** Is 97 prime? **Calculation:** Test divisibility by primes up to √97 ≈ 9.85: 2, 3, 5, 7. 97/2 not whole. 97/3 = 32.33 not whole. 97/5 = 19.4 not whole. 97/7 = 13.86 not whole. So 97 has no prime divisors ≤ √97, therefore prime. **Result:** 97 is prime. Only divisors: 1 and 97. To prove a number is prime: trial divide by all primes up to √n. If none divide, the number is prime.
Large number factoring
**Scenario:** Factor 999. **Calculation:** 999/3 = 333. 333/3 = 111. 111/3 = 37. 37 is prime (not divisible by primes < √37 ≈ 6.1, i.e., 2, 3, 5). So 999 = 3³ × 37. **Result:** 999 = 3³ × 37 = 27 × 37. Useful: GCF(999, 100) = 1 (coprime), LCM(999, 100) = 99,900. Divisor count: (3+1)(1+1) = 8.
When to use this calculator
**Use prime factorization for:**
- **Simplifying fractions**: divide by GCF. - **Finding GCF**: common prime powers. - **Finding LCM**: union of prime powers. - **Simplifying square roots**: pull out paired primes. - **Counting divisors**: from factorization exponents. - **Number theory problems**: divisibility properties. - **Cryptography understanding**: foundation of RSA.
**Key methods:**
- **Trial division**: divide by primes up to √n. - **Factor tree**: visual breakdown. - **Sieve**: list primes first, then divide.
For small numbers (n < 1000): trial division by hand is feasible. For larger numbers: use a calculator or computer.
**Divisibility shortcuts:**
| Divisor | Quick test | |---|---| | 2 | Even (last digit 0,2,4,6,8) | | 3 | Digit sum /3 | | 5 | Ends in 0 or 5 | | 9 | Digit sum /9 | | 11 | Alternating digit sum /11 | | 7 | More complex; use long division |
**Practical examples:**
- **GCF(48, 36)**: 48 = 2⁴ × 3, 36 = 2² × 3². GCF = 2² × 3 = 12. - **LCM(48, 36)**: 2⁴ × 3² = 144. - **Simplify 48/36**: divide by GCF (12): 4/3. - **Divisor count of 720**: 720 = 2⁴ × 3² × 5. Count = 5×3×2 = 30.
**Square root simplification:**
√72 = √(2³ × 3²) = √(2² × 2 × 3²) = 2 × 3 × √2 = 6√2.
Pull out paired primes; leave unpaired under radical.
**Common applications:**
- **Math education**: foundational number theory. - **Algebra**: factoring polynomials uses similar concepts. - **Computer science**: hash design, RSA cryptography. - **Cryptography**: RSA, Diffie-Hellman key exchange. - **Engineering**: divisibility for synchronization. - **Music**: rational frequency ratios. - **Calendar systems**: 60 = 2² × 3 × 5 (highly divisible).
**Why some numbers are special:**
- **Highly composite**: 360 (many divisors). - **Powers of 2**: 1024 = 2¹⁰ (computer-friendly). - **Prime**: only 1 and self (cryptography). - **Mersenne primes**: 2^p - 1 (record-setting primes). - **Perfect numbers**: equal to sum of proper divisors.
**Pitfalls:**
- **1 is not prime**: by convention. - **Negative numbers**: technically integers, factorization extends with sign. - **Very large numbers**: factorization becomes computationally hard. - **Confusing prime with composite**: prime has only 1 and itself; composite has more. - **Forgetting all factors**: write each prime to its highest power. - **For zero**: undefined (0 = 2 × 0 = 3 × 0 = ...).
**Software:**
- **Python**: sympy.factorint(n) returns dict of prime: power. - **Wolfram Alpha**: type "factor 360" for instant result. - **Online calculators**: many available, instant for typical numbers. - **Mathematica**: FactorInteger[n]. - **PARI/GP**: factor(n).
**Computational limits:**
- 10^15: trial division still works in seconds. - 10^20: needs Pollard's rho or QS. - 10^100+: GNFS (General Number Field Sieve), takes years. - 10^200+ (cryptographic): essentially infeasible.
**Educational notes:**
Prime factorization typically taught in 5th-6th grade. Foundation for: - Fractions (simplification, common denominators). - Algebra (polynomial factoring). - Number theory. - Cryptography (high school CS or college).
Visual aids: factor trees, Venn diagrams for GCF/LCM.
**Pitfalls:**
- **1 = not prime**: by mathematical convention. - **Order of factors**: doesn't matter (commutative). - **For 0**: undefined. - **Negative**: -360 = -1 × 2³ × 3² × 5 (with sign). - **For factorization beyond integers**: needs algebraic number theory. - **Mistaking a number for prime when not**: always check all primes ≤ √n.
Common mistakes to avoid
- Treating 1 as prime (it's not by convention).
- Forgetting to check all primes up to √n for primality test.
- Missing factors (e.g., 12 = 2² × 3, not just 2 × 6).
- Mixing up GCF and LCM (different combinations of factorizations).
- For square root simplification: not pulling out all paired primes.
- For composite testing: stopping divisibility tests too early.
- Forgetting 2 (smallest prime).
- For very large numbers: trying trial division when faster methods exist.