What is a prime factorization calculator?
A prime factorization calculator takes a whole number and rewrites it as a product of prime numbers. A prime number is an integer greater than 1 whose only divisors are 1 and itself, such as 2, 3, 5, 7 and 11. Every integer greater than 1 is either prime or can be written as a unique product of primes — a result known as the Fundamental Theorem of Arithmetic. This calculator does that decomposition for you and shows the factors as digits joined by the multiplication sign, for example .
Because the output is just digits and the multiplication symbol, it reads the same in every language.
How does it work?
The calculator uses trial division, the most direct factoring method. Starting from the smallest prime, it repeatedly divides the number by each candidate divisor for as long as the division is exact, then moves on to the next candidate:
- Set a divisor .
- While the number is divisible by , record as a factor and divide the number by .
- Increase and repeat. You only need to test divisors up to the square root of the number, because if exceeds what remains, the leftover value is itself prime.
- If anything greater than 1 is left over at the end, it is a prime factor too.
In formula terms, the result is the product
where each is prime and the primes are listed from smallest to largest, with repeats shown explicitly.
Worked examples
- 12 divides by 2 to give 6, then by 2 again to give 3, which is prime. So .
- 60 divides by 2 to give 30, by 2 again to give 15, then by 3 to give 5, which is prime. So .
- 17 has no divisor up to its square root (about 4.12), so it is prime and the factorization is simply .
- 100 divides by 2 twice to give 25, then by 5 twice to give 1. So .
Practical notes
- The smallest input is 2, since 0, 1 and negative numbers have no prime factorization. Entering 1 or leaving the field blank returns an empty result.
- Repeated factors are listed individually rather than as powers, so 100 appears as instead of .
- Prime factorization is the foundation for finding the greatest common factor and the least common multiple of two numbers: take the primes they share for the GCF, and combine all primes for the LCM. To see every divisor of a number rather than just its primes, use the factor calculator.