Prime Factorization Calculator

Break any integer into its prime factors by trial division, shown as a full division chain and in exponent form like 2² × 5².

Loading calculator…

How to use this calculator

Type any integer greater than 1. The calculator divides it by 2 as many times as possible, then by 3, then 5, and so on, writing down every prime divisor it uses. The result is shown both as a division chain and in compact exponent form, like 22×522^2 \times 5^2.

Tip: Prime factorization is the foundation behind the greatest common factor (GCF) and lowest common multiple (LCM) calculators — both are read directly off the exponents once a number is factored.

What is prime factorization?

Every integer greater than 1 is either prime (its only factors are 1 and itself) or composite, meaning it can be broken down into a product of primes. That breakdown is the number's prime factorization — the unique set of prime "building blocks" that multiply back to the original number.

Method: trial division by increasing primes

  1. Divide the number by 2 repeatedly, writing down a "2" each time it divides evenly, until it no longer does.
  2. Move to the next prime — 3, then 5, then 7, and so on — and repeat.
  3. Stop when the running quotient reaches 1.
  4. The primes written down, multiplied together, reconstruct the original number.

You never need to test composite numbers like 4, 6, 8, or 9: any factor they would catch is already removed by the smaller primes that divide them.

Worked example — factoring 100

100÷2=50(write down 2)100 \div 2 = 50 \quad (\text{write down } 2) 50÷2=25(write down 2)50 \div 2 = 25 \quad (\text{write down } 2) 25÷5=5(write down 5)25 \div 5 = 5 \quad (\text{write down } 5) 5÷5=1(write down 5)5 \div 5 = 1 \quad (\text{write down } 5)

So 100=2×2×5×5=22×52100 = 2 \times 2 \times 5 \times 5 = 2^2 \times 5^2.

The Fundamental Theorem of Arithmetic

Every integer greater than 1 has exactly one prime factorization, up to the order the factors are written in. This is the Fundamental Theorem of Arithmetic — no matter which prime you happen to divide by first, you always end up with the same multiset of primes. It's why 100100 can only ever be 22×522^2 \times 5^2, never anything else.

Why 1 (and 0, and negatives) have no prime factorization

The theorem only applies to integers greater than 1:

  • 1 is the "empty product" — it needs zero prime factors, so it isn't prime and has no factorization to show.
  • 0 can't be written as a finite product of primes at all (every prime times anything eventually gives 0, but never in a unique way).
  • Negative numbers would need a "1-1" factor, and 1-1 isn't prime, so the theorem is stated for positive integers only.

Powering GCF and LCM from prime factorization

Once two numbers are factored into primes, their GCF and LCM can be read straight off the exponents — no extra division needed.

Prime36 = 22×322^2 \times 3^260 = 22×3×52^2 \times 3 \times 5GCF exponent (min)LCM exponent (max)
22222
32112
50101
  • GCF takes the smaller exponent of every shared prime: 22×31=122^2 \times 3^1 = 12.
  • LCM takes the larger exponent of every prime that appears at all: 22×32×5=1802^2 \times 3^2 \times 5 = 180.

This is exactly what the GCF and LCM calculators do internally, using the same trial-division routine as this page.

Factor trees vs. division chains

A factor tree branches a number into two factors at each step, then branches those, until every leaf is prime. The division chain shown here is the same information laid out linearly — each row is one branch of the tree, in the order the primes are discovered. Both notations describe the identical, unique factorization guaranteed by the theorem above.

Frequently asked questions

What is the prime factorization of 100?
100=2×2×5×5=22×52100 = 2 \times 2 \times 5 \times 5 = 2^2 \times 5^2. Dividing 100 by 2 twice gives 25, then dividing by 5 twice gives 1, so the primes used are 2, 2, 5, and 5.
What is prime factorization?
Prime factorization is writing a whole number as a product of prime numbers — the 'building blocks' every integer is made from. It's the same idea as a factor tree, just written as a flat multiplication.
Why does the calculator only test prime divisors, not every number?
Any composite divisor (like 4, 6, or 9) is itself built from smaller primes, which have already been divided out by the time trial division reaches it. Testing 2, 3, 5, 7, 11, ... in order finds every prime factor without wasted work.
Why can't I factor 0, 1, or a negative number?
The Fundamental Theorem of Arithmetic only defines prime factorization for integers greater than 1. The number 1 is the empty product (no primes needed), 0 has no factorization at all, and negative numbers need a sign that isn't a prime, so all three are outside the theorem's scope.
How does prime factorization help find the GCF of two numbers?
Factor both numbers into primes, then for every prime that appears in both lists take the smaller exponent. Multiplying those together gives the GCF — no trial division of the original numbers required.
How does prime factorization help find the LCM of two numbers?
Factor both numbers into primes, then for every prime that appears in either list take the larger exponent. Multiplying those together gives the LCM.
What is the largest number this calculator can factor?
Up to 1,000,000,000 (one billion). Trial division checks primes up to the square root of the input, so even the largest allowed value factors in a fraction of a second.

Related calculators