Prime Factorization Calculator
Break a whole number into its prime factors and see the factorization in expanded form, exponent form, factor pairs, and calculation steps.
Results
A Prime Factorization Calculator breaks a positive integer greater than 1 into a product of prime numbers.
For example:
84 = 2 × 2 × 3 × 7
which can also be written as:
84 = 2² × 3 × 7
Prime factorization is useful for simplifying fractions, finding GCF and LCM, checking divisibility, recognizing perfect squares and cubes, counting divisors, and exploring number-theory relationships.
Enter one positive whole number and review both the expanded prime factors and exponential form.
What prime factorization means
A prime number has exactly two positive divisors:
1
and:
itself
Examples include:
2, 3, 5, 7, 11, 13, 17…
A composite number can be broken into smaller integer factors.
Prime factorization continues that process until every remaining factor is prime.
For example:
60 = 2 × 2 × 3 × 5
So:
60 = 2² × 3 × 5
The prime factorization is unique
Every integer greater than 1 can be expressed as a product of prime numbers in only one essential way.
The order of those prime factors does not matter.
For example:
2 × 2 × 3 × 7
and:
7 × 3 × 2 × 2
represent the same prime factorization of:
84
When written in standard order:
84 = 2² × 3 × 7
This uniqueness is one of the fundamental properties of integers.
How to use the Prime Factorization Calculator
- Enter one positive integer greater than 1.
- Calculate the prime factors.
- Review the expanded form.
- Review the exponential form.
- Multiply the factors back together to verify the result.
- Use the factorization in related GCF, LCM, fraction, or divisor calculations if needed.
Do not enter rounded decimals as though they were integers.
A compact example
Factor:
84
Start with the smallest prime:
84 ÷ 2 = 42
Again:
42 ÷ 2 = 21
Now 21 is not divisible by 2.
Try 3:
21 ÷ 3 = 7
The remaining number:
7
is prime.
So:
84 = 2 × 2 × 3 × 7
or:
84 = 2² × 3 × 7
Why repeated factors use exponents
Instead of writing:
2 × 2 × 2 × 3 × 3 × 5
we can write:
2³ × 3² × 5
The exponent tells you how many times the prime factor appears.
So:
2³ = 2 × 2 × 2
and:
3² = 3 × 3
Exponential notation makes long factorizations easier to read.
Trial division starts with the smallest primes
A common hand method is trial division.
Start with:
2
Then try:
3
Then:
5
Then:
7
and continue through larger primes as necessary.
Each time a prime divides the current value evenly, record that prime and divide again.
Repeat until the remaining quotient is:
1
or itself prime.
Trial division example
Factor:
180
Start with 2:
180 ÷ 2 = 90
Again:
90 ÷ 2 = 45
45 is not divisible by 2.
Try 3:
45 ÷ 3 = 15
Again:
15 ÷ 3 = 5
The remaining:
5
is prime.
Therefore:
180 = 2 × 2 × 3 × 3 × 5
or:
180 = 2² × 3² × 5
A factor tree gives the same result
Prime factorization can also be shown with a factor tree.
For:
360
you might start with:
360 = 36 × 10
Then:
36 = 6 × 6
10 = 2 × 5
Continue:
6 = 2 × 3
and:
6 = 2 × 3
So the prime leaves are:
2, 2, 2, 3, 3, 5
Therefore:
360 = 2³ × 3² × 5
Different factor trees still end the same way
You could instead begin:
360 = 8 × 45
Then:
8 = 2 × 2 × 2
and:
45 = 5 × 9
with:
9 = 3 × 3
Again:
360 = 2³ × 3² × 5
The branches can differ, but the final prime factors do not.
Do not stop while a composite factor remains
Suppose you write:
84 = 4 × 21
That is a valid factorization, but it is not a prime factorization because:
4
and:
21
are composite.
Continue:
4 = 2 × 2
and:
21 = 3 × 7
Then:
84 = 2² × 3 × 7
Every final factor must be prime.
The number 1 is not prime
A prime number must have exactly two positive divisors.
The number:
1
has only one positive divisor:
1
Therefore, 1 is neither prime nor composite.
It is called a:
unit
Because of this, 1 is not included as a prime factor.
For example, do not write:
12 = 1 × 2² × 3
The prime factorization is simply:
12 = 2² × 3
The number 1 has no prime factorization
The prime factorization theorem applies to integers:
greater than 1
Since 1 is not prime and cannot be decomposed into a nonempty product of primes, it has no prime factorization in the usual sense.
The calculator should treat 1 as a boundary case rather than inventing a factor list.
Zero has no finite prime factorization
Zero cannot be written as a finite product of prime numbers.
For any prime:
p
we have:
0 = p × 0
and the process never ends in a finite prime-only product.
Therefore:
0
does not have a finite prime factorization.
Negative integers need a factor of −1
For a negative integer, factor the positive magnitude and attach:
−1
For example:
−60
becomes:
−1 × 60
Since:
60 = 2² × 3 × 5
then:
−60 = −1 × 2² × 3 × 5
The prime factors describe the positive magnitude.
Check whether the remaining quotient is prime
During trial division, you do not need to keep testing every possible integer forever.
If the remaining quotient has no prime divisor at or below its square root, then it is prime.
For example:
97
has:
√97 ≈ 9.85
So you only need to test primes up to:
9.85
Those are:
2, 3, 5, and 7
None divide 97.
Therefore:
97 is prime
Why checking up to the square root is enough
If a composite integer:
n
has factors:
a × b = n
and both:
a > √n
and:
b > √n
then:
a × b > n
which is impossible.
So every composite number must have at least one factor less than or equal to its square root.
That is why trial division can stop once the candidate divisor squared exceeds the remaining quotient.
Divisibility by 2
An integer is divisible by 2 when its last digit is:
0, 2, 4, 6, or 8
For example:
146
is even, so:
146 ÷ 2 = 73
Since 73 is prime:
146 = 2 × 73
Divisibility by 3
Add the digits.
If the digit sum is divisible by 3, the original number is also divisible by 3.
For example:
231
Digit sum:
2 + 3 + 1 = 6
Since 6 is divisible by 3:
231 ÷ 3 = 77
Then:
77 = 7 × 11
So:
231 = 3 × 7 × 11
Divisibility by 5
An integer is divisible by 5 when its final digit is:
0
or:
5
For example:
145
ends in 5.
So:
145 ÷ 5 = 29
Since 29 is prime:
145 = 5 × 29
Divisibility by 11
One useful test for 11 compares alternating digit sums.
For example:
121
Compute:
1 − 2 + 1 = 0
Since the result is a multiple of 11:
121
is divisible by 11.
Indeed:
121 = 11²
For ordinary factorization, direct division may still be simpler for smaller numbers.
Reapply divisibility tests to the quotient
Suppose you are factoring:
540
Start:
540 ÷ 2 = 270
The new quotient 270 is also even:
270 ÷ 2 = 135
Now use divisibility by 3:
1 + 3 + 5 = 9
So:
135 ÷ 3 = 45
Again:
45 ÷ 3 = 15
Again:
15 ÷ 3 = 5
Then 5 is prime.
Therefore:
540 = 2² × 3³ × 5
Prime factorization helps reduce fractions
Consider:
84/126
Factor the numerator:
84 = 2² × 3 × 7
Factor the denominator:
126 = 2 × 3² × 7
Shared factors include:
2 × 3 × 7 = 42
Cancel those factors:
84/126 = 2/3
Prime factorization shows exactly why the fraction reduces.
Prime factors make the GCF easy to see
Consider:
72 = 2³ × 3²
and:
120 = 2³ × 3 × 5
For the GCF, use the prime factors appearing in both numbers with the lowest shared exponent.
So:
2³ × 3¹ = 24
Therefore:
GCF(72,120) = 24
Use the GCF Calculator when you want the common factor directly.
Prime factors also make the LCM easy to see
Using the same values:
72 = 2³ × 3²
120 = 2³ × 3 × 5
For the LCM, use each required prime with the highest exponent appearing in either number:
2³ × 3² × 5
So:
LCM(72,120) = 360
Use the LCM Calculator when the goal is the least common multiple.
Lowest exponents for GCF, highest for LCM
This distinction is worth remembering:
| Calculation | Prime-exponent rule |
|---|---|
| GCF | Lowest exponent shared by all inputs |
| LCM | Highest exponent appearing in any input |
Prime factorization makes both rules visible.
Prime factorization can reveal perfect squares
A positive integer is a perfect square when every exponent in its prime factorization is even.
For example:
144 = 2⁴ × 3²
Both exponents:
4
and:
2
are even.
Therefore:
144
is a perfect square.
Indeed:
144 = 12²
Why even exponents identify squares
If:
n = p²ᵃ × q²ᵇ
then:
n = (pᵃqᵇ)²
Every prime factor can be split evenly between the two identical factors.
For:
144 = 2⁴ × 3²
take half each exponent:
2² × 3 = 12
So:
√144 = 12
A number with an odd exponent is not a perfect square
Consider:
72 = 2³ × 3²
The exponent of 2 is:
3
which is odd.
So 72 is not a perfect square.
Its square root is not a whole number.
Prime factorization can reveal perfect cubes
A positive integer is a perfect cube when every prime exponent is divisible by:
3
For example:
216 = 2³ × 3³
Both exponents are divisible by 3.
Take one-third of each exponent:
2¹ × 3¹ = 6
Therefore:
216 = 6³
Higher perfect powers follow the same idea
For a positive integer to be a perfect fourth power, every prime exponent must be divisible by:
4
For a perfect fifth power, every exponent must be divisible by:
5
and so on.
Prime factorization makes these patterns easy to inspect.
Prime factorization can count positive divisors
Suppose:
n = pᵃqᵇ
A positive divisor can contain:
p
with exponent:
0 through a
and:
q
with exponent:
0 through b
Therefore the number of positive divisors is:
(a + 1)(b + 1)
This idea extends to any number of distinct prime factors.
Divisor-count example
Consider:
72 = 2³ × 3²
For factor 2, a divisor may contain:
2⁰, 2¹, 2², or 2³
That gives:
4 choices
For factor 3:
3⁰, 3¹, or 3²
That gives:
3 choices
Total number of positive divisors:
4 × 3 = 12
So 72 has:
12 positive divisors
General divisor-count formula
If:
n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ
then the number of positive divisors is:
(a₁ + 1)(a₂ + 1)…(aₖ + 1)
This formula depends on having the complete prime factorization.
Missing even one repeated prime factor changes the divisor count.
Prime factorization can identify square-free numbers
A positive integer is:
square-free
when no prime factor appears with exponent 2 or greater.
For example:
30 = 2 × 3 × 5
Every prime exponent is 1.
So 30 is square-free.
But:
12 = 2² × 3
contains:
2²
so 12 is not square-free.
A prime input factors only as itself
If the entered number is already prime, its prime factorization is simply the number itself.
For example:
97 = 97
There is no further decomposition into smaller prime factors.
Likewise:
13 = 13
and:
101 = 101
Composite numbers always have multiple prime factors counting repetition
For example:
49 = 7²
Although there is only one distinct prime:
7
it appears twice.
And:
77 = 7 × 11
contains two distinct primes.
Prime factorization tracks both:
which primes appear
and:
how many times each appears
Expanded and exponential forms answer slightly different needs
For:
360
expanded form:
2 × 2 × 2 × 3 × 3 × 5
makes repeated factors visible individually.
Exponential form:
2³ × 3² × 5
is more compact.
Both represent the same factorization.
A useful calculator can show both.
Multiply the factors to check the answer
For:
84 = 2² × 3 × 7
verify:
2² = 4
Then:
4 × 3 × 7
= 12 × 7
= 84
If the product does not return the original number, a factor was:
- omitted;
- repeated too many times;
- or entered incorrectly.
Check that every listed base is prime
Suppose a result is shown as:
72 = 8 × 9
The product is correct:
8 × 9 = 72
but this is not a prime factorization.
Both 8 and 9 are composite.
Continue:
8 = 2³
9 = 3²
So:
72 = 2³ × 3²
A correct product is not enough; every factor must also be prime.
Large prime factorization can become difficult
Trial division works well for ordinary educational and everyday integers.
But factorization becomes computationally difficult for sufficiently large numbers.
Modern cryptographic systems can rely on this difficulty in carefully chosen settings.
The calculator should not be treated as a tool for attacking cryptographic keys or performing specialized cryptanalysis.
Its purpose is ordinary mathematical factorization.
Integer size affects practical performance
A small number such as:
360
can be factored almost instantly.
A much larger integer may require significantly more computation depending on:
- number size;
- prime structure;
- algorithm;
- and available computing resources.
There is a major difference between classroom-sized factorization and advanced computational number theory.
Decimal values are not standard prime-factorization inputs
Prime factorization applies to integers.
A decimal such as:
12.5
should not be silently rounded to:
13
or:
12
Those are different numbers.
If a decimal can be expressed as a rational number, its numerator and denominator can be factored separately after conversion, but that is a different task.
Fractions have numerator and denominator factorizations
For example:
18/35
has numerator:
18 = 2 × 3²
and denominator:
35 = 5 × 7
This can help with simplifying or comparing rational values.
But the fraction itself is not a positive integer, so it does not have a single ordinary prime factorization in the same sense.
Common prime-factorization mistakes to avoid
Treating 1 as prime
The number 1 is neither prime nor composite.
Stopping with a composite factor
Continue until every factor is prime.
Losing repeated factors
If 2 divides the number three times, record:
2³
not simply:
2
Listing a composite number as a prime factor
A factor such as 9 must continue to:
3 × 3
Factoring zero
Zero has no finite prime factorization.
Ignoring the sign of a negative input
Factor the positive magnitude and include:
−1
separately.
Testing every integer unnecessarily
After small divisors are removed, you only need prime candidate divisors up to the square root of the remaining quotient.
Quick prime factorization examples
| Integer | Prime factorization |
|---|---|
| 12 | 2² × 3 |
| 18 | 2 × 3² |
| 24 | 2³ × 3 |
| 36 | 2² × 3² |
| 60 | 2² × 3 × 5 |
| 72 | 2³ × 3² |
| 84 | 2² × 3 × 7 |
| 90 | 2 × 3² × 5 |
| 100 | 2² × 5² |
| 360 | 2³ × 3² × 5 |
These factorizations can be checked by multiplying the prime powers.
When to use another calculator
Use the LCM Calculator when you need the smallest common multiple of several integers.
Use the GCF Calculator when you need the largest common divisor shared by several integers.
For ordinary arithmetic and order-of-operations checks, use the Basic Calculator.
FAQ
What is prime factorization?
Prime factorization expresses an integer greater than 1 as a product of prime numbers.
What is the prime factorization of 84?
84 = 2² × 3 × 7
Is 97 prime?
Yes.
No prime number at or below:
√97 ≈ 9.85
divides it.
So its prime factorization is simply:
97
What is the prime factorization of 1?
The number 1 has no prime factorization.
It is neither prime nor composite.
Can zero be prime-factorized?
No.
Zero does not have a finite prime factorization.
How do I factor a negative integer?
Factor its positive magnitude and include:
−1
For example:
−12 = −1 × 2² × 3
Why are exponents used?
They show repeated prime factors compactly.
For example:
2 × 2 × 2 = 2³
Can a factor tree start in different ways?
Yes.
Different valid factor-tree branches eventually produce the same prime factors.
How do I know when to stop trial division?
Once the remaining quotient is prime.
When testing candidate divisors, no new divisor needs to be tested once its square is greater than the remaining quotient.
How does prime factorization help with GCF?
Use the shared primes with the lowest exponents.
How does prime factorization help with LCM?
Use every required prime with the highest exponent appearing in any input.
How do prime factors identify a perfect square?
Every prime exponent must be even.
How do prime factors identify a perfect cube?
Every prime exponent must be divisible by 3.
Can prime factorization tell me how many divisors a number has?
Yes.
If:
n = pᵃqᵇ…
the number of positive divisors is:
(a + 1)(b + 1)…
Can the calculator factor very large cryptographic numbers?
It is intended for ordinary mathematical and educational integer factorization, not cryptographic key analysis.
Mathematics reference
For additional explanations and worked examples involving prime numbers, factors, divisibility, GCF, LCM, and fractions, see:
Keep factoring until every factor is prime
A Prime Factorization Calculator does more than find any set of numbers whose product equals the input.
It continues until every factor is prime.
For a number such as:
360
different factor trees may begin in different places, but they all finish with:
2³ × 3² × 5
That unique collection of prime factors can then be reused for simplifying fractions, calculating GCF and LCM, testing perfect powers, and studying other divisibility properties.
The simplest check is also the most reliable: multiply every reported prime factor back together and confirm that the product equals the original integer.
