Introduction
Prime factorization is the process of breaking a number down into the smallest prime numbers that multiply together to give you that number. For example, the prime factorization of 12 is 2 × 2 × 3, because those prime numbers multiply to equal 12. Every whole number greater than 1 can be written as a product of primes, and there is only one way to do it.1 This is known as the Fundamental Theorem of Arithmetic.
Our Prime Factorization Calculator makes this process quick and simple. Just enter a whole number greater than 1, and the tool will find its prime factors for you. This is useful for simplifying fractions, finding the greatest common factor (GCF), calculating the least common multiple (LCM), or just learning how numbers are built from their basic parts.
How to Use Our Prime Factorization Calculator
Enter any whole number greater than 1, and this calculator will break it down into its prime factors. You will see the results in exponential form and product form, the number of divisors with a full list when there are 500 or fewer, and an optional factor tree diagram for numbers with up to 50 prime factors.
Enter a Number or Expression: Type the whole number you want to factorize into the input field. You can enter a simple number like 84000 or a math expression using +, -, *, /, ^, and parentheses. For example, typing 2^64 - 1 will calculate that value first and then find its prime factors. You can enter numbers of up to 1,000 digits. If a number has prime factors too large to find quickly, the calculator tells you so instead of showing a result.
Number Base: Choose whether your input is in Decimal (base 10) or Hexadecimal (base 16). Most users should leave this set to Decimal. Select Hexadecimal if you are working with hex numbers. In Hexadecimal mode, every number you type is read as hex, including each number in an expression, and the factors and divisors are shown in hex.
Show Factor Tree: Check this box if you want to see a visual factor tree diagram that shows how your number splits into prime factors step by step. This is helpful for learning how prime factorization works.
Verbose Output: Check this box to see a detailed step-by-step breakdown of every division performed during the factorization process. Each step shows which number was divided, what it was divided by, and the result.
Calculate Button: Click this button after entering your number to run the calculation. The results will appear below, showing the input number, the number of distinct prime factors, the total count of divisors, the exponential form, the product form, a list of all prime factors, and a list of every divisor of your number when there are 500 or fewer.
What Is Prime Factorization?
Prime factorization is the process of breaking a number down into the set of prime numbers that multiply together to give that number. A prime number is a number greater than 1 that can only be divided evenly by 1 and itself.2 Examples of prime numbers include 2, 3, 5, 7, 11, and 13.3 Every whole number greater than 1 is either a prime number itself or can be written as a product of prime numbers.1 This idea is so important that mathematicians call it the Fundamental Theorem of Arithmetic.
For example, the number 84,000 can be broken down into 2 × 2 × 2 × 2 × 2 × 3 × 5 × 5 × 5 × 7. No matter what method you use, you will always get the same set of prime factors. That is what makes prime factorization unique: every number has exactly one prime factorization.1
How Prime Factorization Works
The simplest method is called trial division.7 You start by dividing the number by the smallest prime, which is 2. You keep dividing by 2 until it no longer goes in evenly. Then you move on to 3, then 5, then 7, and so on. You repeat this process until the remaining number is 1. Each time a prime divides evenly, that prime is one of the factors.1
For very large numbers, trial division can be slow. A number made of two large primes of about the same size can take about as many divisions as its square root.7 In those cases, advanced methods like Pollard's Rho algorithm are used. This algorithm is built to find the smaller factors of a large number. It works through a sequence of numbers and watches for a repeat, which reveals a factor far sooner than testing every possible divisor.7 This calculator uses trial division for smaller factors and automatically switches to Pollard's Rho when dealing with large composite numbers.
Key Terms in the Results
- Exponential Form: Groups repeated prime factors using exponents. For instance, 2 × 2 × 2 is written as 23.
- Product Form: Lists every prime factor individually, multiplied together.
- Divisors: All the numbers that divide evenly into the original number. The total count of divisors is found by adding 1 to each exponent in the exponential form and multiplying those results together.4 For 25 × 31 × 53 × 71, the divisor count is (5+1) × (1+1) × (3+1) × (1+1) = 96, since 6 × 2 × 4 × 2 = 96. The factor tree provides a visual diagram showing how the number splits step by step into its prime building blocks.
Why Prime Factorization Matters
Prime factorization is used throughout math and everyday applications. It is the basis for finding the greatest common factor (GCF) and least common multiple (LCM) of two or more numbers, which helps when simplifying fractions or solving problems with ratios. In computer science, the difficulty of factoring extremely large numbers is what keeps modern encryption and online security systems safe.1 In the RSA encryption method, the public key's modulus is a product of distinct odd primes.6 Multiplying large primes together is easy, but recovering them from the product is extraordinarily hard.
Prime factorization also helps when simplifying square roots, because each pair of equal prime factors under the root can come out as one factor. Knowing how to break a number into its prime factors is a fundamental and powerful skill.