Prime Factorization Calculator

Break a number into its prime factors, find GCF and LCM, check if a number is prime, and build your own factor tree by clicking through the splits yourself.

Prime Factorization
GCF & LCM
Prime or Composite?
Build Your Own Factor Tree

Click any non-prime (white) box to split it into two factors. Keep going until every box is teal (prime).

All calculations run in your browser. Nothing is sent to a server.

Most prime factorization tools show you a completed factor tree or division table and expect you to read it. This one includes that (the "Prime Factorization" mode gives the full breakdown instantly), plus a mode most competitors don't offer: an interactive tree where you click through the splits yourself, one factor pair at a time, until every branch ends in a prime number. It's a more active way to learn the process instead of just watching the finished result.

Related Calculators

How Each Mode Works

1. Prime Factorization

Every whole number greater than 1 can be written as a product of prime numbers in exactly one way, ignoring order. Finding that breakdown means repeatedly dividing by the smallest prime that fits until only primes remain.

360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5

2. Greatest Common Factor and Least Common Multiple

Once two numbers are broken into their prime factors, the greatest common factor (GCF) is found by multiplying the primes they share, using the lower exponent for each. The least common multiple (LCM) multiplies every prime that appears in either number, using the higher exponent for each.

24 = 2³ × 3, 30 = 2 × 3 × 5
GCF = 2 × 3 = 6
LCM = 2³ × 3 × 5 = 120

3. Prime or Composite

A prime number has exactly two factors: 1 and itself. Anything with more than two factors is composite. Checking simply means testing whether any number up to the square root of the target divides it evenly.

4. Build Your Own Factor Tree

Rather than showing a finished tree, this mode starts with just the number you entered and lets you pick how to split it at each step. Any pair of factors works, since the final set of prime factors will be the same regardless of which split you choose first. Once a branch reaches a prime, it locks in place, and the tree is complete once every branch is prime.

Where Prime Factorization Actually Comes Up

Simplifying Fractions

Reducing a fraction to lowest terms is really a GCF problem in disguise. Finding the greatest common factor of the numerator and denominator, then dividing both by it, is exactly the calculation covered in the GCF mode above.

Adding Fractions with Different Denominators

Before two fractions can be added, they need a common denominator, and the smallest one that works is the LCM of the two original denominators. This is one of the most direct everyday uses of the LCM calculation.

Cryptography and Computer Security

Modern internet security relies on a lopsided fact about prime numbers: multiplying two large primes together is fast, but working backward from the product to find the original primes is extremely slow once the numbers get large enough, even for powerful computers. RSA encryption, one of the most widely used methods for securing online communication, is built directly on this asymmetry, using primes hundreds of digits long rather than the small examples covered here. This is a large part of why prime factorization is more than just a school exercise, even though the underlying maths taught in school uses much smaller numbers than the ones actually used to secure a website.

School Coursework

Prime factorization is typically introduced in late elementary or early middle school and keeps showing up afterward, since it's the foundation for GCF, LCM, and simplifying fractions, all of which build on the same underlying skill.

Prime Factorizations of Common Numbers

Number Prime Factorization
122² × 3
242³ × 3
602² × 3 × 5
1002² × 5²
3602³ × 3² × 5

Common Mistakes

Treating 1 as a prime number. By definition, a prime number has exactly two factors. Since 1 only has one factor (itself), it doesn't qualify, even though it can feel like it should.
Stopping a factor tree too early. Every branch has to end in a prime number. Stopping at a composite number like 4 or 9 partway down a branch gives an incomplete factorization.
Confusing GCF with LCM. The GCF is always smaller than or equal to both original numbers, while the LCM is always larger than or equal to both. Mixing up which one a problem is asking for is a common source of wrong answers.
Forgetting repeated factors. If a prime divides a number more than once, like 2 dividing 360 three times, all three instances belong in the factorization, not just one.

Frequently Asked Questions

What is prime factorization?

It's the process of breaking a number down into the set of prime numbers that multiply together to produce it. Every whole number greater than 1 has exactly one such breakdown.

How do I find the GCF of two numbers?

Break both numbers into their prime factors, then multiply together the primes they have in common, using the smaller exponent wherever a prime appears in both. The "GCF & LCM" mode above shows this step by step.

Why is 1 not considered a prime number?

A prime number is defined as having exactly two distinct factors, 1 and itself. Since 1 only has one factor, it doesn't meet that definition, and excluding it also keeps prime factorization unique for every number.

What's the difference between GCF and LCM?

The GCF is the largest number that divides evenly into both numbers, useful for simplifying fractions. The LCM is the smallest number that both original numbers divide into evenly, useful for finding a common denominator.

Does it matter which factors I pick first when building a factor tree?

No. Whichever pair of factors you split first, the tree will always end with the same set of prime factors, since every number has only one prime factorization. Try the "Build Your Own Factor Tree" mode above and pick a different split to see this for yourself.

|