How to Find the Prime Factorization of a Number

Learn factor trees, prime factorization in exponent form, divisors, and how primes connect to GCD — with a free prime factorization tool.

By Generatr Team

Prime factorization breaks a positive integer into a product of prime numbers — the unique building blocks of that integer (order aside). You use it to simplify fractions, find GCD and LCM, count divisors, and understand why some numbers feel “more composite” than others.

This guide covers what primes are, how to build a factor tree, how to write exponent form, how divisors fall out of the primes, and how factorization supports GCD work. For instant trees and exponent form, open the free prime factorization tree calculator.

You will leave able to factor by hand for homework sizes and verify larger integers without guessing.

Free tool

Use the Prime Factorization Tree now

Open the interactive prime factorization tree in your browser — free, instant, no signup.

Open Prime Factorization Tree

What Is Prime Factorization?

A prime number is an integer greater than 1 whose only positive divisors are 1 and itself: 2, 3, 5, 7, 11, 13, …. A composite number has a factor other than 1 and itself. The number 1 is neither prime nor composite.

Prime factorization writes n as a product of primes. By the fundamental theorem of arithmetic, every integer n > 1 has a factorization into primes that is unique up to order.

  • 12 = 2 × 2 × 3 = 2² × 3
  • 360 = 2³ × 3² × 5
  • 17 = 17 (already prime)
  • 100 = 2² × 5²

Writing repeated primes with exponents keeps large factorizations readable. Exponent notation is the same power language covered more broadly in the power calculator guide.

Factorization assumes a positive integer context for school and tool use. Zero and negatives are outside the usual “prime factors of n” homework story (absolute value can map a signed integer to a positive magnitude first — see the absolute value guide when signs appear).

How Do You Build a Factor Tree?

A factor tree splits a number into two factors, then splits any composite branch, until every leaf is prime.

Method

  1. Start with n at the root.
  2. Find any pair of integers a × b = n with a > 1, b > 1 (often start by dividing by 2, 3, 5, …).
  3. Draw branches to a and b.
  4. If a branch is composite, split it again.
  5. Stop when every leaf is prime. Multiply the leaves to recover n.

Example: 84

  • 84 = 2 × 42
  • 42 = 2 × 21
  • 21 = 3 × 7
  • Leaves: 2, 2, 3, 7 → 2² × 3 × 7

Different split orders (84 = 4 × 21 vs 6 × 14) yield the same multiset of prime leaves. That uniqueness is the point of the theorem — the tree shape can vary; the primes cannot.

For large n, trial division up to √n is the classic hand method. When n grows past comfortable mental math, the free prime factorization tree tool shows factor tree structure, exponent form, and related divisor stats.

How Do You Write Factorization in Exponent Form?

Group identical primes and count them:

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

with primes p₁ < p₂ < … usually written in ascending order for standard form.

Examples

  • 72 = 2 × 2 × 2 × 3 × 3 → 2³ × 3²
  • 500 = 2² × 5³
  • 97 = 97¹ (or simply 97)

Exponent form makes products and GCDs mechanical: to multiply factorizations, add exponents of matching primes; to take powers of n, multiply every exponent. Roots and perfect powers also become visible — n is a perfect square if every exponent is even.

When you only need p^a style evaluation (not full factorization), the power calculator evaluates bases and exponents directly.

How Do Prime Factors Give You All Divisors?

If n = p₁a₁ × … × pₖaₖ, every positive divisor of n has the form p₁b₁ × … × pₖbₖ with 0 ≤ bᵢ ≤ aᵢ.

Number of positive divisors = (a₁ + 1)(a₂ + 1)…(aₖ + 1).

Example: 360 = 2³ × 3² × 5

  • Divisor count = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24
  • Sample divisors: 1, 2, 3, 4, 5, 6, 8, 9, 10, …, 360

Many factorization tools also report the sum of divisors (σ(n)), which is useful in number-theory classifications (perfect, abundant, deficient numbers). You do not need that sum for basic fraction work, but it is a free consequence of the same prime data.

Listing divisors by hand for huge n is tedious; use exponent counting first, then generate only the divisors you need.

How Does Factorization Help With GCD, LCM, and Ratios?

Once two numbers are in prime exponent form, GCD and LCM are min/max games on exponents:

  • GCD — take the minimum exponent for each prime that appears in both
  • LCM — take the maximum exponent for each prime that appears in either

Example

48 = 2⁴ × 3, 180 = 2² × 3² × 5.

  • GCD = 2² × 3 = 12
  • LCM = 2⁴ × 3² × 5 = 720

You can also compute GCD with the Euclidean algorithm without full factorization; factorization shines when you already need primes for other reasons or when teaching structure. Dedicated workflows live in the GCD and LCM calculator guide and the matching GCD LCM calculator.

Simplifying ratios and fractions is the same idea: cancel shared prime factors. The ratio simplifier guide focuses on reducing a:b to lowest terms — factorization is the engine underneath.

How Do You Use a Prime Factorization Calculator?

Enter a positive integer, read the tree or prime list, and copy exponent form for homework or notes.

  1. Open the free prime factorization tree tool.
  2. Enter a positive integer within the tool’s supported range.
  3. Review the factor tree or ordered prime factors.
  4. Copy the exponent form (for example 2³ × 3² × 5).
  5. Note divisor count or sum of divisors if shown.
  6. Cross-check a small example by hand so you trust the layout.

Client-side tools are ideal for classwork and coding interviews. Cryptographic-scale integers (hundreds of digits) need specialized algorithms beyond a browser factor tree — school and contest sizes are the intended fit here.

What Mistakes Happen When Factoring?

Watch for these errors:

  • Stopping at a composite leaf — every leaf must be prime (for example leaving 9 unsplit)
  • Treating 1 as a prime factor — omit 1 from the product
  • Missing a repeated factor — 12 is 2² × 3, not 2 × 3
  • Confusing factors with multiples — factors divide n; multiples are n, 2n, 3n, …
  • Assuming uniqueness of tree shape — shapes vary; prime multiset does not
  • Trial dividing past √n without reason — if no prime factor ≤ √n remains, the cofactor is prime

Practice on 60, 84, 100, and 360 until exponent form feels automatic. Then verify with the prime factorization tree and connect reduced fractions via the ratio simplifier.

This guide is educational. Contest time limits, CAS software, and research factorization of huge integers follow different tooling — use what matches your n and context.

Step-by-Step Instructions

  1. 1Open the free prime factorization tree tool on Generatr.
  2. 2Enter a positive integer you want to factor.
  3. 3Split composites using a factor tree or successive division by primes.
  4. 4Continue until every factor is prime.
  5. 5Rewrite repeated primes in exponent form (for example 2³ × 3 × 7).
  6. 6Optionally count divisors as the product of each (exponent + 1).
  7. 7Use min/max exponents when comparing two factorizations for GCD or LCM.
  8. 8Verify a small example by multiplying the primes back to the original n.

Frequently Asked Questions

How do you find the prime factorization of a number?+

Divide n by the smallest primes (2, 3, 5, …) until the remaining cofactor is 1, or build a factor tree that splits composites until every leaf is prime. Write the result as a product of primes, preferably in exponent form.

What is a factor tree?+

A factor tree is a diagram that starts at n and branches into factor pairs until all leaves are prime. Different trees can look different, but they end with the same prime factors.

How do you write prime factorization in exponent form?+

Group equal primes and count them. Example: 72 = 2 × 2 × 2 × 3 × 3 = 2³ × 3².

How many divisors does a number have?+

If n = p₁^a₁ × … × pₖ^aₖ, the number of positive divisors is (a₁+1)…(aₖ+1). For 360 = 2³ × 3² × 5, that is 4 × 3 × 2 = 24 divisors.

How does prime factorization help with GCD?+

Write both numbers in prime exponent form and take the minimum exponent for each shared prime. Example: gcd(48, 180) = 2² × 3 = 12.

Is Generatr’s prime factorization tree free?+

Yes. Factor integers in your browser with tree visualization, exponent form, and divisor-related outputs — no account required.

Ready to try it yourself?

Use the free Prime Factorization Tree — no download, no account.

Launch Prime Factorization Tree