Prime factorization breaks a whole number into a product of prime numbers. This calculator lets you enter any integer greater than or equal to 2 and instantly see its prime factors, the factorization written in exponent form, and a simple division-style breakdown of the steps. It is designed for students, teachers, and anyone exploring number theory or working with factors, greatest common divisors, and least common multiples.
On this page you will find a clear definition of prime factorization, the key formulas behind it, a worked example that matches what the calculator shows, and a discussion of how to interpret your results. There is also a comparison table of methods, plus a short section on limitations and assumptions so you know what this tool does well and where manual methods or more advanced software may be needed.
A prime number is an integer greater than 1 that has exactly two positive divisors: 1 and itself. Examples include 2, 3, 5, 7, 11, and 13. Composite numbers, such as 12 or 84, have more than two positive divisors and can be written as products of smaller integers.
Prime factorization of an integer n means writing n as a product of prime numbers. For example:
When you use this calculator, the output shows both the repeated prime factors and a compact representation using exponents, which is usually the most convenient way to use prime factors in later calculations.
The theoretical basis for prime factorization is the Fundamental Theorem of Arithmetic. It states that every integer greater than 1 can be written uniquely (apart from the order of the factors) as a product of prime powers. In symbolic form:
Here:
For a concrete example, if n = 84, the calculator will show:
This format is especially useful when you compute the greatest common divisor (GCD) or least common multiple (LCM) of several numbers by comparing their prime factor exponents.
The calculator uses a simple, step-by-step method often called trial division. It starts with the smallest prime number, 2, and repeatedly divides the input integer by 2 as long as the result is an integer. Then it moves on to the next primes (3, 5, 7, and so on) until all factors are found.
At a high level, the algorithm works like this:
The results panel then shows:
When you enter an integer and click the factorization button, the output usually includes three related views of the same information. Understanding each one will help you make use of the prime factorization in later problems.
This is the most direct description of the prime factorization: the calculator lists every prime factor, including repeats. For example, for 72 you might see:
Prime factors: 2, 2, 2, 3, 3
This tells you that 72 can be written as 2 × 2 × 2 × 3 × 3.
The exponent form groups identical prime factors. For 72 the same result becomes:
72 = 23 × 32
This representation is compact and is the standard way to express the prime factorization of an integer in textbooks. It is also the preferred format for computing GCDs, LCMs, and for simplifying radicals or rational expressions.
The division trace shows the trial division steps that led to the factorization. It might look like a small table or list, for example for 84:
84 ÷ 2 = 42 42 ÷ 2 = 21 21 ÷ 3 = 7 7 ÷ 7 = 1
Reading this from top to bottom shows exactly how the prime factors were peeled off. This is helpful when you want to understand the method, verify that the calculator is correct, or teach someone else how prime factorization works.
Suppose you enter 84 into the calculator.
The output will typically show:
84 ÷ 2 = 42
42 ÷ 2 = 21
21 ÷ 3 = 7
7 ÷ 7 = 1
If you want to split 84 items into equal groups, these factors help you see every possible group size that divides 84 without a remainder, such as 2, 3, 4, 6, 7, 12, 14, 21, 28, and 42.
If you enter 97, the calculator will check divisibility by small primes: 2, 3, 5, 7, and so on. None of them divide 97 evenly, and when the trial divisor squared exceeds 97, the algorithm concludes that 97 is prime.
The output will show:
This matches the definition of a prime number: its only positive factors are 1 and itself.
There are several ways to compute the prime factorization of a number. The calculator here uses trial division because it is simple, reliable, and easy to explain. Other methods are more efficient for very large integers but also more complex.
| Method | How it works | Best for | Pros | Cons |
|---|---|---|---|---|
| Trial division | Test divisibility by successive primes (2, 3, 5, …) until the remaining quotient is 1 or prime. | Small to medium integers (typical classroom examples). | Very easy to understand and implement; shows clear step-by-step prime factorization. | Becomes slow for very large integers with many digits. |
| Factor trees | Split the number into any pair of factors, then keep factoring each branch until only primes remain. | Manual calculations and teaching visual learners. | Visual, intuitive representation of how a number breaks down into primes. | Less systematic; you still rely on trial division at each step. |
| Advanced algorithms | Use number-theoretic techniques (e.g., Pollard's rho, quadratic sieve) to find non-trivial factors more quickly. | Very large integers, particularly in cryptographic settings. | Much faster than trial division on huge numbers. | Complex to implement; not necessary for standard school-level problems. |
Prime factorization is more than an abstract number theory topic. It appears in many everyday and educational contexts. Common uses include:
To keep the tool fast and easy to use, a few practical assumptions and limitations apply:
Being aware of these limitations helps align your expectations with what the calculator is built to do. For very large or unusual inputs, you may want to cross-check results with another tool or a computer algebra system.
Prime factorization is used to simplify fractions, find greatest common divisors and least common multiples, analyze divisibility, simplify radicals, and understand the structure of integers in number theory. It is a core skill in many algebra and arithmetic topics.
One basic approach is to test divisibility by all primes less than or equal to the square root of the number. If none divide evenly, the number is prime. The calculator essentially automates this process for you and reports whether the input is composite (with its prime factors) or prime.
The tool uses straightforward trial division, which is efficient for small and medium-sized integers commonly found in school and everyday problems. For very large integers with many digits, factoring may be slow or restricted, and specialized algorithms or software are recommended.
Mathematically, no. The Fundamental Theorem of Arithmetic guarantees that the multiset of prime factors is unique, but they can be written in any order. By convention, this calculator lists primes in ascending order for consistency and readability.