Calculators
Prime Factorization Calculator
Find the prime factors of a whole number.
Prime Factorization Calculator tool
Loading tool…
Jump to a section
About This Tool
Prime factorization writes an integer as a product of prime numbers. Because every integer greater than 1 has one unique prime factorization apart from factor order, the result is a useful building block for simplifying fractions, finding common factors and multiples, checking divisibility, comparing number patterns, and studying factor trees. Enter one whole number to see both compact exponent notation and the expanded list of repeated prime factors.
How To Use It
- Enter a whole number of 2 or greater.
- Read the compact prime factorization, where repeated prime factors use exponents.
- Use the expanded factor list to see every repeated prime separately, or copy the compact result.
- If the result is the original number itself, the number is prime.
- For negative numbers, factor the absolute value separately and attach -1 outside the prime factorization if your work requires it.
Examples
Prime factorization of 360
360 = 2^3 × 3^2 × 5, or 2 × 2 × 2 × 3 × 3 × 5 in expanded form.
Prime factorization of 97
97 is already prime, so its prime factorization is simply 97.
Prime factorization of 1024
1024 is a power of two: 2^10.
Prime factorization of 84
84 = 2^2 × 3 × 7, or 2 × 2 × 3 × 7 in expanded form.
Prime factorization of 99991 × 97
For large composites, the calculator keeps dividing by possible factors and reports the exact primes it finds, such as 97 × 99991 when both factors are prime.
Useful Notes
What makes a factor prime?
A prime number is an integer greater than 1 whose only positive divisors are 1 and itself. Prime factorization keeps dividing by prime divisors until no composite factor remains.
Prime, composite, and the number 1
Prime factorization is defined here for integers greater than 1. A composite number breaks into smaller prime factors. A prime number's factorization is itself. The number 1 is neither prime nor composite, so it is rejected.
How this calculator factorizes numbers
The calculation removes factors of 2 first, then tests odd divisors. Once a possible divisor is larger than the remaining value divided by that divisor, the remaining value—if greater than 1—must itself be prime.
Exponent and expanded notation
Repeated factors can be shortened with exponents. For example, 72 = 2 × 2 × 2 × 3 × 3 = 2^3 × 3^2. Both forms represent exactly the same product.
Why prime factorization is unique
The fundamental theorem of arithmetic says every integer greater than 1 has one prime factorization apart from the order of factors. That is why factor trees that split numbers differently still end at the same primes.
Using factors for GCD, LCM, and fractions
Prime factors make it easier to find shared factors, least common multiples, and fraction reductions by hand. Use the smaller shared exponents for GCD, larger exponents across both numbers for LCM, and common prime factors to simplify fractions.
Input limits
The tool accepts integers from 2 through JavaScript's maximum safe integer, but it also caps trial-division work to keep the browser responsive. Large values with small factors can finish quickly; a large prime or nearly-prime value may be declined with a calculation-limit message instead of making the page unresponsive.
FAQ
Is 1 a prime number?
No. A prime number has exactly two positive divisors, 1 and itself. The number 1 has only one positive divisor, so prime factorization starts at 2.
Does every number have a unique prime factorization?
Every integer greater than 1 can be expressed as a product of primes uniquely apart from the order of those factors. This is the fundamental theorem of arithmetic.
What does exponent notation mean?
An exponent shows repeated multiplication of the same prime. For example, 2^3 means 2 × 2 × 2.
How does prime factorization help with GCD and LCM?
For GCD, take shared prime factors using the smaller exponents. For LCM, take every prime appearing in either number using the larger exponents. Hanakash's GCD & LCM Calculator can calculate those values directly.
Can this calculator factor negative numbers?
This page focuses on the standard prime factorization of positive integers greater than 1. A negative integer can be written as -1 times the prime factorization of its absolute value, but -1 is not prime.
Can I factor decimals or fractions?
No. Prime factorization applies to whole numbers. Convert the value to the integer you want to study before using this calculator.
Why might a very large number be declined?
Exact trial division can require an enormous number of checks for a large prime or nearly-prime value. The calculator stops after a fixed work limit to protect browser responsiveness; try a smaller number or one with smaller prime factors when that message appears.