Prime Factorization Calculator

Find the prime factors of any number and generate a detailed factor tree. Calculate prime decomposition with step-by-step solutions and mathematical explanations.

How to use: Enter any positive integer to find its prime factors, see the complete factorization, and view the factor tree breakdown.

Prime Factorization Calculator

Prime Factorization Results
Prime Factors
Factor Tree

Understanding Prime Factorization

Prime factorization is the process of breaking down a composite number into its prime number components. Every integer greater than 1 either is prime itself or can be represented as a unique product of prime numbers, according to the Fundamental Theorem of Arithmetic.

Prime numbers are natural numbers greater than 1 that have no positive divisors other than 1 and themselves. Examples include 2, 3, 5, 7, 11, 13, 17, 19, 23, and so on. Understanding prime factorization is essential for many mathematical concepts including finding greatest common divisors, least common multiples, and simplifying fractions.

What is a Prime Number?

Prime Number Definition

A prime number is a natural number > 1 with exactly two factors: 1 and itself

Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29...

Composite Number Definition

A composite number has more than two factors

Examples: 4, 6, 8, 9, 10, 12, 14, 15, 16, 18...

Prime Factorization Methods

Method Description Best For Example
Trial DivisionDivide by smallest primes systematicallySmall to medium numbers60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5
Factor TreeBreak number into factor pairs repeatedlyVisual learners60 = 6 × 10, then factor 6 and 10
Prime DecompositionSystematic division by primes in orderLarge numbersStart with 2, then 3, 5, 7, 11...
Sieve MethodsAdvanced algorithms for very large numbersComputer calculationsQuadratic sieve, number field sieve

Step-by-Step Process

Step 1: Start with the smallest prime number (2) and check if it divides the given number
Step 2: If divisible, divide and repeat with the quotient. If not, try the next prime
Step 3: Continue until the quotient becomes 1 or a prime number
Step 4: List all prime factors, using exponents for repeated factors

Prime Factorization Examples

Number Prime Factorization Exponential Form Factor Count
122 × 2 × 32² × 36 factors
182 × 3 × 32 × 3²6 factors
242 × 2 × 2 × 32³ × 38 factors
302 × 3 × 52 × 3 × 58 factors
362 × 2 × 3 × 32² × 3²9 factors
482 × 2 × 2 × 2 × 32⁴ × 310 factors
602 × 2 × 3 × 52² × 3 × 512 factors
722 × 2 × 2 × 3 × 32³ × 3²12 factors

Applications of Prime Factorization

Greatest Common Divisor (GCD)

GCD = product of common prime factors with lowest powers

Example: GCD(12, 18) = 2¹ × 3¹ = 6

Least Common Multiple (LCM)

LCM = product of all prime factors with highest powers

Example: LCM(12, 18) = 2² × 3² = 36

Special Cases and Properties

Case Description Example
Prime NumbersCannot be factored further7 = 7 (prime)
Perfect SquaresAll prime factors have even exponents36 = 2² × 3²
Perfect CubesAll prime factors have exponents divisible by 327 = 3³
Powers of PrimesOnly one unique prime factor32 = 2⁵

Factor Tree Construction

Method 1 - Systematic Division: Always start with the smallest prime and work your way up.

Method 2 - Factor Pairs: Find any two factors, then continue factoring each branch.

Method 3 - Mixed Approach: Combine both methods for efficiency and verification.

Prime Numbers Up to 100

First 25 Primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Computational Complexity

Small Numbers (< 10⁶): Trial division is efficient and straightforward.

Medium Numbers (10⁶ - 10¹²): Pollard's rho algorithm and similar methods are preferred.

Large Numbers (> 10¹²): Advanced algorithms like quadratic sieve or general number field sieve.

Cryptographic Numbers: Factoring very large numbers (hundreds of digits) is computationally infeasible with current technology, which forms the basis of RSA encryption.

Common Mistakes to Avoid

Not checking for repeated factors: Always continue dividing by the same prime until it no longer divides evenly
Forgetting that 1 is not prime: The number 1 has special status and is neither prime nor composite
Stopping too early: Continue factoring until all factors are prime numbers
Missing the uniqueness: The prime factorization of any number is unique (up to order of factors)

Verification Methods

Multiplication Check: Multiply all prime factors to verify you get the original number.

Divisibility Check: Ensure each factor divides the original number evenly.

Prime Check: Verify that all factors in your final answer are indeed prime numbers.

Pro Tip: For large numbers, start with small primes (2, 3, 5) to reduce the problem size quickly. Use divisibility rules to speed up the process: numbers ending in 0, 2, 4, 6, 8 are divisible by 2; sum of digits divisible by 3 means the number is divisible by 3; numbers ending in 0 or 5 are divisible by 5.