Prime Factors Calculator

A prime factors calculator breaks any whole number down into its basic building blocks: prime numbers. Every integer greater than 1 is either prime itself or can be expressed as a unique product of primes, and this tool does that work instantly. Whether you're doing homework, solving a number theory problem, or just satisfying your curiosity about a big number, understanding prime factorization gives you real insight into how numbers are structured. This page covers not only how the calculator works but also the methods behind it, so you actually understand what you're looking at.

Enter Details

Result

Prime factors

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Find Prime Factors

Finding the prime factors of a number means identifying every prime that divides evenly into it. The process is straightforward: start with the smallest prime (2), check if it divides your number, and if it does, divide and repeat. Move to the next prime when the current one no longer divides evenly. Keep going until you're left with 1.

For example, to find the prime factors of 60, you'd divide by 2 to get 30, divide by 2 again to get 15, then divide by 3 to get 5. Since 5 is already prime, you stop. The prime factors of 60 are 2, 2, 3, and 5, written as 2² × 3 × 5.

Small numbers are easy to do by hand. Larger numbers benefit from a systematic method or a calculator, especially when the factors are large primes that aren't immediately obvious.

Prime Factorization Calculator

A prime factorization calculator automates the trial division process, testing divisibility by primes in sequence and outputting the complete factorization quickly. You enter a positive integer, hit calculate, and get back the full prime factorization, often displayed in both standard form and exponent form.

These calculators are useful for a range of tasks: simplifying fractions, finding greatest common factors, computing least common multiples, and verifying manual work. Most will handle numbers well into the millions without any issue.

One thing to keep in mind is that every positive integer greater than 1 has exactly one prime factorization. So whatever method you use, if you do it correctly, you'll always get the same answer. The calculator just gets you there faster.

Prime Factorization Formula

There's no single algebraic formula that spits out prime factors, but prime factorization does follow a defined structure. Any integer n greater than 1 can be written as a product of prime numbers raised to whole-number exponents:

n = p₁a₁ × p₂a₂ × p₃a₃ × … × pₖaₖ

Here, p₁, p₂, … pₖ are distinct prime numbers in ascending order, and a₁, a₂, … aₖ are their corresponding exponents (each at least 1). This is the canonical way to express a number's prime factorization, and it's the format most calculators use in their output.

Fundamental Theorem of Arithmetic

The Fundamental Theorem of Arithmetic is the reason prime factorization works the way it does. It states that every integer greater than 1 is either a prime number or can be represented as a product of prime numbers, and that representation is unique regardless of the order in which you write the factors.

This uniqueness is what makes prime factorization so powerful. It means you can use a number's prime factorization as a kind of fingerprint. Two different numbers will always have different factorizations, and there's no ambiguity about which factorization belongs to which number. The theorem was known to ancient Greek mathematicians and remains one of the foundational results in number theory.

Prime Factor Exponent Form

When a prime appears more than once in a factorization, it's cleaner to write it using exponents rather than repeating it. This is called exponent form (or index form). So instead of writing 2 × 2 × 2 × 3 × 3, you write 2³ × 3².

Exponent form makes it much easier to work with large factorizations, especially when calculating GCF or LCM. You can compare the exponents of each shared prime directly, rather than counting repeated factors by hand. Most calculators will display results in this format by default.

Factor Tree Method

The factor tree method is probably the most visual way to find prime factors. It's the approach most people learn in school, and it works by repeatedly splitting a number into any two factors until every branch ends in a prime. The primes at the tips of all the branches are the prime factors of the original number.

It's worth noting that you don't have to start with the smallest factors. You can split 60 into 6 and 10, or into 4 and 15, or even 2 and 30. It doesn't matter. As long as you keep breaking down composite numbers, you'll always arrive at the same set of primes at the end. That's the Fundamental Theorem of Arithmetic in action.

Creating a Prime Factor Tree

To build a factor tree, start by writing your number at the top. Draw two branches descending from it and write any two factors that multiply to give that number. Circle any factor that's already prime since it won't be split further. For any composite factor, draw two more branches and split it again. Repeat until every open branch ends in a prime, which you then circle.

Let's say you're factoring 84. You might split it into 4 and 21. Then split 4 into 2 and 2 (both prime, circle them), and split 21 into 3 and 7 (both prime, circle them). Collecting all the circled primes gives you 2 × 2 × 3 × 7, or 2² × 3 × 7.

The specific splits you choose don't affect the final answer, just the shape of the tree. Some people prefer to always pull off the smallest prime factor at each step; others just pick whatever pair comes to mind first.

Reading Prime Factor Trees

Once your tree is built, reading it is simple: collect every circled prime number at the tips of the branches. Those are your prime factors. Write them in order from smallest to largest, group repeats using exponents, and you have the complete prime factorization.

If you're working with a tree someone else drew, check that every branch tip is actually a prime number. A common mistake is stopping at a composite number like 9 or 15 and treating it as a final factor. If a tip isn't prime, the tree isn't finished and the factorization isn't complete.

Trial Division Method

Trial division is the most straightforward algorithmic approach to prime factorization. You systematically test whether primes divide your number, starting from 2 and working upward.

  1. Start with the smallest prime, 2. Divide your number by 2 as many times as it divides evenly. Record the number of times you divide.
  2. Move to the next prime (3), and repeat. Divide as many times as possible.
  3. Continue through the primes: 5, 7, 11, 13, and so on.
  4. Stop when the prime you're testing is greater than the square root of the remaining number. If the remaining number is greater than 1 at that point, it's a prime factor itself.

The square root shortcut saves a lot of time. If no prime up to the square root of n divides it evenly, then n must be prime. You don't need to test every number up to n itself. For large numbers, this is the difference between a manageable calculation and an impossibly long one.

Trial division is what most basic prime factorization calculators use under the hood, since it's reliable and easy to implement even if it's not the fastest algorithm for very large numbers.

Prime Factors vs Factors

These two terms get mixed up constantly, so it's worth being clear. A factor of a number is any integer that divides it evenly. A prime factor is a factor that also happens to be a prime number.

Take 12 as an example. Its factors are 1, 2, 3, 4, 6, and 12. Its prime factors are only 2 and 3. The full set of factors includes composite numbers like 4 and 6, but prime factors are the irreducible pieces only.

When a calculator or textbook asks for the prime factorization, it wants the prime factors with their exponents. When it asks for all factors or divisors, it wants the complete list including 1 and the number itself. These are related but different things, and confusing them leads to wrong answers pretty quickly.

Prime Numbers and Composite Numbers

A prime number has exactly two distinct positive divisors: 1 and itself. Examples include 2, 3, 5, 7, 11, and 13. Note that 1 is not prime, by definition, even though it only has one divisor. This distinction matters because the Fundamental Theorem of Arithmetic wouldn't hold if 1 were considered prime.

A composite number has more than two divisors, meaning it can be divided evenly by at least one number other than 1 and itself. Examples: 4, 6, 9, 15, 100. Every composite number can be broken into prime factors, which is exactly why prime factorization is possible and useful.

The number 2 is the only even prime. Every other even number is composite because it's divisible by 2. That's also why trial division always starts with 2.

Distinct Prime Factors

When people refer to the distinct prime factors of a number, they mean the unique primes in its factorization, without counting repeats. For 72 (which is 2³ × 3²), the distinct prime factors are just 2 and 3, even though 2 appears three times and 3 appears twice.

The count of distinct prime factors (often written as ω(n) in number theory) is a separate concept from the total count of prime factors with multiplicity (written as Ω(n)). For most everyday math, you're working with the distinct primes, but in more advanced contexts the distinction matters. A calculator will typically show you both the full factorization and the list of distinct primes.

Prime Factorization Examples

Working through a few examples helps make the process concrete. Here are several numbers factored out completely:

NumberPrime FactorizationExponent Form
182 × 3 × 32¹ × 3²
482 × 2 × 2 × 2 × 32⁴ × 3¹
1002 × 2 × 5 × 52² × 5²
2102 × 3 × 5 × 72 × 3 × 5 × 7
3602 × 2 × 2 × 3 × 3 × 52³ × 3² × 5¹

Notice that 210 is interesting because it's the product of four consecutive primes and none of them repeat. Numbers like that (called primorials) show up in various areas of mathematics. Also notice how 360 packs a lot of factors into a relatively small number, which is why it's historically been used for things like degrees in a circle.

Finding GCF Using Prime Factors

The greatest common factor (GCF) of two or more numbers is the largest number that divides all of them evenly. Prime factorization gives you a clean method to find it.

Here's how it works: factor each number completely, then identify the prime factors they share. For each shared prime, take the lowest exponent it appears with across all the numbers. Multiply those together and you have the GCF.

Example: find the GCF of 48 and 180.

  • 48 = 2⁴ × 3¹
  • 180 = 2² × 3² × 5¹

The shared primes are 2 and 3. The lowest exponent of 2 is 2 (from 180), and the lowest exponent of 3 is 1 (from 48). So GCF = 2² × 3¹ = 4 × 3 = 12.

This method scales well to three or more numbers. Just factor all of them, find the primes common to every number, and take the minimum exponent for each. The prime 5 doesn't count here because it only appears in 180, not in 48.

Finding LCM Using Prime Factors

The least common multiple (LCM) is the smallest number that's divisible by all of the numbers in your set. The prime factorization approach is basically the opposite of the GCF method: instead of taking the minimum exponent for shared primes, you take the maximum exponent for every prime that appears in any of the numbers.

Using the same numbers as before, 48 and 180:

  • 48 = 2⁴ × 3¹
  • 180 = 2² × 3² × 5¹

Every prime that appears in either number: 2, 3, and 5. Maximum exponent of 2 is 4 (from 48), maximum of 3 is 2 (from 180), maximum of 5 is 1 (from 180). So LCM = 2⁴ × 3² × 5¹ = 16 × 9 × 5 = 720.

A useful check: GCF × LCM always equals the product of the two original numbers when you're working with exactly two numbers. Here, 12 × 720 = 8,640, and 48 × 180 = 8,640. That checks out.

Divisors and Multiples from Prime Factorization

One underrated use of prime factorization is figuring out exactly how many divisors a number has, without listing them all. If a number has the factorization p₁a × p₂b × p₃c, then the total number of divisors is (a+1)(b+1)(c+1). Each exponent gets bumped up by 1 because you can include that prime zero through a times in a divisor.

For 360 = 2³ × 3² × 5¹, the number of divisors is (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24. You can verify this by listing them all, but the formula gets you there instantly.

As for multiples, every multiple of n must include all of n's prime factors at least to their given exponents. So multiples of 12 (= 2² × 3) must include at least two 2s and one 3 in their prime factorization. This framing is helpful in number theory and cryptography, where the structure of divisors matters a great deal.

Applications of Prime Factorization in Mathematics

Prime factorization shows up in more places than most people expect. Here are some of the main areas where it plays a real role:

  • Simplifying fractions: To reduce a fraction to lowest terms, find the GCF of the numerator and denominator using their prime factorizations, then divide both by it.
  • Cryptography: Modern encryption systems like RSA rely on the fact that multiplying two large primes is easy, but factoring the resulting product is computationally very hard. The security of much of the internet depends on this property.
  • Modular arithmetic: Many results in modular math, including Euler's theorem and the Chinese Remainder Theorem, depend on the prime structure of the modulus.
  • Perfect squares and square roots: A number is a perfect square if and only if every prime in its factorization has an even exponent. This gives you an easy way to simplify square roots.
  • Number theory proofs: Dozens of classical theorems, from Euclid's proof of infinite primes to results about Pythagorean triples, use prime factorization as a core tool.

It's genuinely one of those foundational concepts that keeps appearing at every level of mathematics, from middle school fractions to graduate-level algebra. Getting comfortable with it pays off across a surprising range of problems.

Other Maths Calculators

Explore all