Skip to content

Prime Factorization Calculator — Free Online Prime Factor Finder

Break down any number into its prime factors instantly with a visual factor tree, exponent notation, and complete step-by-step solution.

Number Type

Composite Number

Prime Factorization of 360

2^3 x 3^2 x 5

Factor Tree

360 = 2 x 180

180 = 2 x 90

90 = 2 x 45

45 = 3 x 15

15 = 3 x 5

360 = 2 x 2 x 2 x 3 x 3 x 5

Prime Factors

Unique primes: 2, 3, 5

Total prime factors: 6 (with multiplicity)

How to Use the Prime Factorization Calculator

  1. Enter a number: Type any positive integer greater than 1 into the input field. The default is 360, which demonstrates a rich factorization. The calculator handles values up to 1,000,000.
  2. Check the classification: The calculator immediately tells you whether your number is prime or composite. Prime numbers have no factorization beyond themselves.
  3. Read the exponent form: The main result shows the prime factorization in compact exponent notation (e.g., 2^3 x 3^2 x 5). This is the standard mathematical representation.
  4. Study the factor tree: Each line in the factor tree shows a division step — the number being divided, the prime divisor, and the quotient. Follow the tree from top to bottom to trace the complete factorization process.
  5. Review the summary: The bottom panel lists the unique prime factors and the total count of prime factors (with multiplicity), giving a complete picture of the number's structure.

Results update instantly as you change the number, making it easy to explore how different numbers decompose into primes. Try entering consecutive numbers to see how dramatically factorizations can differ.

Prime Factorization Method

Fundamental Theorem of Arithmetic

n = p1^a1 x p2^a2 x p3^a3 x ... (unique representation)

Trial Division

Divide by 2, 3, 5, 7, 11, ... up to sqrt(n)

Factor Count Formula

Total factors = (a1 + 1)(a2 + 1)(a3 + 1)...

Variables Explained

  • n: The number being factored. Must be a positive integer greater than 1.
  • p1, p2, p3, ...: The distinct prime factors, listed in ascending order. These are the irreducible building blocks of n.
  • a1, a2, a3, ...: The exponents (multiplicities) of each prime factor, indicating how many times each prime divides n.

Step-by-Step Example

Find the prime factorization of 504:

  1. 504 / 2 = 252 (first factor: 2)
  2. 252 / 2 = 126 (second factor: 2)
  3. 126 / 2 = 63 (third factor: 2)
  4. 63 / 3 = 21 (fourth factor: 3)
  5. 21 / 3 = 7 (fifth factor: 3)
  6. 7 is prime (sixth factor: 7)

504 = 2^3 x 3^2 x 7. We can verify: 8 x 9 x 7 = 504. The number has (3+1)(2+1)(1+1) = 24 total factors. The unique primes are 2, 3, and 7, with a total of 6 prime factors counting multiplicity.

Practical Examples

Example 1: Kevin's Cryptography Lesson

Kevin is studying RSA encryption in his computer science class. His professor asks him to demonstrate why factoring the product of two primes is hard. He starts with small numbers to understand the concept.

  • Kevin picks two primes: 13 and 17
  • Product: 13 x 17 = 221
  • Prime factorization of 221 = 13 x 17 (easy to verify when you know the factors)
  • But given only 221, finding 13 and 17 requires testing all primes up to sqrt(221) = 14.87

For this small number, factoring is easy. But RSA uses primes with 300+ digits each, making the product a 600+ digit number. No known classical algorithm can factor such numbers in a reasonable time, which is what makes RSA secure. This example illustrates the computational asymmetry at the heart of public-key cryptography.

Example 2: Laura's Fraction Simplification

Laura needs to simplify 2520/3780 for her math homework. She uses prime factorization to find the GCF efficiently.

  • 2520 = 2^3 x 3^2 x 5 x 7
  • 3780 = 2^2 x 3^3 x 5 x 7
  • GCF = 2^2 x 3^2 x 5 x 7 = 4 x 9 x 5 x 7 = 1260
  • 2520/1260 = 2, 3780/1260 = 3
  • Simplified: 2/3

By comparing the prime factorizations side by side, Laura quickly identified the GCF as 1260 and simplified the fraction to 2/3. This method is more reliable than trial-and-error division and works for any size numbers. Use our GCF calculator for direct GCF computation.

Example 3: Nathan's Perfect Square Check

Nathan needs to determine whether 1764 is a perfect square for a geometry problem. He uses prime factorization to check.

  • 1764 = 2^2 x 3^2 x 7^2
  • All exponents (2, 2, 2) are even
  • Therefore, 1764 is a perfect square
  • sqrt(1764) = 2^1 x 3^1 x 7^1 = 42

A number is a perfect square if and only if all exponents in its prime factorization are even. By the same logic, it is a perfect cube if all exponents are divisible by 3. Nathan confirms 1764 = 42^2, giving him the side length needed for his geometry problem. This technique extends to identifying any perfect power.

Prime Factorization Reference Table

Number Prime Factorization Unique Primes Total Factors
12 2^2 x 3 2, 3 6
72 2^3 x 3^2 2, 3 12
100 2^2 x 5^2 2, 5 9
360 2^3 x 3^2 x 5 2, 3, 5 24
1000 2^3 x 5^3 2, 5 16
2520 2^3 x 3^2 x 5 x 7 2, 3, 5, 7 48

Tips and Complete Guide

The Trial Division Method

Trial division is the simplest factorization algorithm and works well for numbers up to millions. Start with 2 and divide repeatedly until 2 no longer goes in evenly. Move to 3, then 5, 7, 11, and each successive prime. You only need to test primes — composite trial divisors are unnecessary because they would already have been caught by their prime factors. Stop when the remaining quotient is less than the square of the current trial divisor, because the remaining number must be prime at that point.

Applications in Number Theory

Prime factorization connects to virtually every concept in number theory. Euler's totient function phi(n) — the count of numbers less than n that are coprime to n — is computed directly from the prime factorization. The Mobius function, the Liouville function, and the divisor function all depend on it. Understanding a number's prime structure reveals its divisibility properties, its position among perfect squares and cubes, and its relationships to other numbers through GCF and LCM.

Factor Trees vs. Ladder Method

Two common visual methods exist for prime factorization. Factor trees branch downward, splitting numbers into two factors at each level until all leaves are prime. The ladder method (or stacked division) divides by primes on the left side, writing quotients below. Both produce the same result. Factor trees allow flexibility in choosing which factors to split first, while the ladder method is more systematic. Our calculator displays the ladder-style approach for clarity, always dividing by the smallest prime first.

Prime Factorization and Simplification

Beyond finding GCF, prime factorization simplifies many operations. To simplify a radical like sqrt(288): factor 288 = 2^5 x 3^2, then extract pairs from under the radical: sqrt(288) = sqrt(2^4 x 2 x 3^2) = 2^2 x 3 x sqrt(2) = 12*sqrt(2). To determine if a fraction terminates as a decimal, check if the denominator's prime factors (after simplification) are only 2s and 5s. These techniques are essential in algebra, precalculus, and beyond.

Common Mistakes to Avoid

  • Including composite factors: Prime factorization must only contain prime numbers. Writing 12 = 4 x 3 is not a prime factorization because 4 is composite. The correct form is 12 = 2^2 x 3.
  • Missing a factor: Always verify by multiplying all the prime factors back together. If the product does not equal the original number, you have made an error.
  • Forgetting multiplicity: If a prime divides the number multiple times, you must count each occurrence. Writing 72 = 2 x 3^2 is wrong — it should be 72 = 2^3 x 3^2.
  • Stopping too early: After dividing out small primes, the remaining quotient might still be composite. Always check if the quotient is prime before declaring the factorization complete.
  • Thinking 1 is prime: The number 1 is not a prime number and should never appear in a prime factorization. Including 1 would violate the uniqueness guaranteed by the Fundamental Theorem of Arithmetic.

Frequently Asked Questions

Prime factorization is the process of expressing a composite number as a product of its prime factors. Every integer greater than 1 can be uniquely represented as a product of prime numbers (this is guaranteed by the Fundamental Theorem of Arithmetic). For example, 360 = 2^3 x 3^2 x 5. This representation is unique regardless of the order in which you write the factors. Prime factorization is the foundation of number theory and has practical applications in cryptography, computer science, and mathematics.

Start by dividing the number by the smallest prime (2). Keep dividing by 2 until it no longer divides evenly, then move to the next prime (3), then 5, 7, 11, and so on. For example, 360: 360/2=180, 180/2=90, 90/2=45 (2 appears 3 times), 45/3=15, 15/3=5 (3 appears 2 times), 5 is prime. Result: 360 = 2^3 x 3^2 x 5. Our calculator performs this process instantly and displays a factor tree showing each division step.

A factor tree is a visual diagram that breaks down a number into its prime factors step by step. Starting with the original number at the top, you split it into two factors at each level, continuing until all branches end in prime numbers. For example, 60 splits into 2 x 30, then 30 splits into 2 x 15, then 15 splits into 3 x 5. The prime factors at the leaves (2, 2, 3, 5) give the complete factorization: 60 = 2^2 x 3 x 5. Our calculator shows this tree structure in text form.

The Fundamental Theorem of Arithmetic states that every integer greater than 1 either is a prime number itself or can be represented as a product of prime numbers in a unique way (up to the order of the factors). This means prime factorization is not arbitrary — there is exactly one way to factor any number into primes. For example, 12 is always 2^2 x 3, never 2 x 6 (since 6 is not prime) in its prime form. This uniqueness is crucial for the correctness of many algorithms in mathematics and computer science.

Prime factorization provides a systematic method for finding both GCF and LCM. To find the GCF, take the minimum power of each common prime factor. To find the LCM, take the maximum power of each prime factor. For 72 = 2^3 x 3^2 and 90 = 2 x 3^2 x 5: GCF = 2^1 x 3^2 = 18, LCM = 2^3 x 3^2 x 5 = 360. Use our <a href='/math/number-theory/gcf-calculator' class='text-primary-600 hover:text-primary-800 underline'>GCF calculator</a> or <a href='/math/number-theory/lcm-calculator' class='text-primary-600 hover:text-primary-800 underline'>LCM calculator</a> for these calculations.

RSA encryption, which secures most internet communication, relies on the difficulty of factoring large numbers. While multiplying two large primes is easy (p x q = n), finding p and q given only n is computationally infeasible for numbers with hundreds of digits. This asymmetry — easy to multiply, hard to factor — is the security foundation of RSA. Current best algorithms require billions of years to factor a 2048-bit RSA key. Quantum computers could theoretically break this using Shor's algorithm, which is why post-quantum cryptography is being developed.

If a number is already prime, its prime factorization is simply itself. For example, the prime factorization of 17 is just 17 — there are no smaller prime factors to find. Our calculator detects prime numbers and displays a message confirming the number is prime. Primes are the building blocks from which all other integers are constructed through multiplication.

For small to medium numbers (up to millions), trial division works well and is what our calculator uses. For very large numbers, specialized algorithms like the Quadratic Sieve or General Number Field Sieve are needed. The largest number factored by a general-purpose algorithm (RSA-250) had 250 digits and required enormous computational resources. Our calculator efficiently handles numbers up to 1,000,000, which covers virtually all educational and practical needs.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources