The formula
How it works
Prime factorization breaks a whole number down into the prime numbers that multiply to make it. Enter a number and the calculator finds its unique set of prime factors, written with exponents.
FAQ
What is a prime number?
A prime is a whole number greater than 1 whose only divisors are 1 and itself, like 2, 3, 5, 7 and 11. Every other whole number is a product of primes.
Why is the factorization unique?
The fundamental theorem of arithmetic says every whole number above 1 has exactly one prime factorization, apart from the order of the factors. That uniqueness is what makes primes the “building blocks” of numbers.
Are 0 and 1 prime numbers?
No. 1 is neither prime nor composite because it has only one divisor, and 0 has no prime factorization since every number divides it. Prime factorization is defined for whole numbers 2 and above.
How do you find prime factors by hand?
Divide the number by the smallest prime that fits, 2, then keep dividing by that same prime until it no longer divides evenly, then move to the next prime (3, 5, 7…) and repeat. A factor tree, where you split the number into any two factors and keep branching, gives the same result.
Why do you only need to check primes up to the square root?
If a number n has no prime factor at or below its square root, it cannot have two factors both larger than the square root either, since their product would exceed n. So once trial division passes \(\sqrt{n}\), any remainder left over is itself prime.
What is the largest prime factor used for?
It is a common way to summarize a factorization in one number, useful in puzzles and number-theory problems. Finding the largest prime factor of very large numbers is also computationally hard, which is part of why factoring underpins some encryption schemes.
Can this calculator factor very large numbers?
It handles typical numbers quickly using trial division, but extremely large numbers (dozens of digits) become slow with this method, since specialized algorithms are needed for factoring at that scale — the same difficulty that keeps certain cryptographic systems secure.
About the prime factorization calculator
This calculator breaks a whole number down into its prime factors — the prime numbers that multiply together to produce it. Prime factorization is a cornerstone of number theory, because every whole number above 1 has exactly one set of prime factors. Knowing them is the key to simplifying fractions, finding greatest common factors and least common multiples, and understanding how numbers are built.
How to use it
Type a whole number and the calculator returns its prime factorization, written with exponents where a prime repeats. For example, 360 factors into 2³ × 3² × 5, meaning three 2s, two 3s and one 5 multiplied together. Larger numbers simply take a few more steps. If you enter a prime number, the factorization is just the number itself, since it has no smaller factors.
The formula
Any whole number can be written as , a product of primes raised to powers. The calculator finds it by trial division: it divides by the smallest prime as many times as it can, then moves to the next, and so on. Because a factor larger than the square root of must pair with one smaller, it only needs to test primes up to .
Where it is used
Prime factorization is used to simplify fractions and to compute greatest common factors and least common multiples, all of which come straight from comparing prime factors. It underlies the security of much modern cryptography, where the difficulty of factoring very large numbers keeps data safe. It also appears in scheduling and pattern problems, and it is a standard topic in school maths for building number sense.