Prime Factorization Calculator

Free prime factorization calculator that breaks an integer greater than 1 into its unique prime factors, showing both the product 2 × 2 × 2 × 3 × 3 × 5 and the exponential form 2³ × 3² × 5.

Prime factorization calculator

Break an integer greater than 1 into its unique prime factors.

Prime factorization of 360

23 × 32 × 5

2 × 2 × 2 × 3 × 3 × 5

6 prime factors

Prime factorization calculator guide

Prime factorization is the process of writing a whole number greater than 1 as a product of prime numbers. A prime has exactly two distinct positive divisors — 1 and itself — so 2, 3, 5, 7, and 11 are prime, while 4, 6, 8, 9, and 12 are composite. The fundamental theorem of arithmetic says that every integer greater than 1 has exactly one prime factorization, up to the order of the factors: 360 is always 2 × 2 × 2 × 3 × 3 × 5, never a different set of primes.

Enter an integer greater than 1 and select Calculate. The calculator uses trial division — dividing out 2, then odd integers up to the square root of what remains — and reports every prime factor in increasing order, the number of factors, and the compact exponential form that groups repeats as powers.

How to use this prime factorization calculator

  1. Enter the integer: Type a whole number greater than 1, for example 360. Decimals, empty input, 0, 1, and negative numbers are rejected.
  2. Select Calculate: Press Calculate to factor the number. Invalid input produces a descriptive error instead of a result.
  3. Read both forms: The large result is the exponential form (2³ × 3² × 5). Below it, the expanded product lists every prime in order (2 × 2 × 2 × 3 × 3 × 5), along with how many prime factors were found.
  4. Reset or share: Use Reset to return to the example 360, or copy the link to share the current integer — the input is encoded in the page URL.

Formula and variables

The fundamental theorem of arithmetic guarantees a unique factorization of this shape for every integer n > 1. The calculator finds the primes by trial division: divide n by 2 until it is odd, then test odd candidates 3, 5, 7, … while the candidate squared is at most the remaining value. Each time a candidate divides the remainder, it is recorded and the remainder is reduced. Whatever is left at the end, if greater than 1, is itself a prime. Repeated primes are then grouped into exponents so 2 × 2 × 2 × 3 × 3 × 5 is written 2³ × 3² × 5.

n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ, with primes p₁ < p₂ < … < pₖ and exponents aᵢ ≥ 1
nInput integer
The whole number being factored; must be greater than 1. (unitless integer)
pᵢPrime factor
A prime that divides n. Factors are reported in increasing order. (unitless integer)
aᵢExponent
How many times pᵢ appears in the factorization; omitted in the exponential form when it is 1. (unitless integer)

Worked example: prime factorization of 360

Factor the default example 360 by successive division, which matches the calculator result.

Integer
360
  1. 360 is even, so divide by 2: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45. Three factors of 2.
  2. 45 is odd. 45 ÷ 3 = 15, 15 ÷ 3 = 5. Two factors of 3.
  3. 5 is prime and greater than 1, so it is the last factor.
  4. Collect the primes in order: 2 × 2 × 2 × 3 × 3 × 5.
  5. Group repeats into exponents: 2³ × 3² × 5.

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

Six prime factors multiply to 360, and by the fundamental theorem of arithmetic no other combination of primes does. The exponential form is the usual way to write the same factorization when comparing GCF and LCM.

Understanding your results

Expanded product

The product lists every prime factor in increasing order, with repeats written out: 360 = 2 × 2 × 2 × 3 × 3 × 5. This is the form a factor tree produces at its leaves, and it is the form you multiply back to recover n.

Exponential form

Repeated primes are grouped as powers, so the same factorization is 2³ × 3² × 5. A prime that appears once is written without an exponent. This is the canonical shape used in the fundamental theorem of arithmetic and the starting point for GCF (smallest exponents) and LCM (largest exponents).

Prime numbers

If the input is itself prime, the factorization is a single factor — for example 97 = 97. That is a valid result, not an error: a prime is its own unique prime factorization.

Assumptions

  • The input is a whole number greater than 1; 1 is neither prime nor composite and has no prime factorization.
  • Factors are reported in non-decreasing order, so the factorization is unique as a sequence, not only as a multiset.
  • The exponential form omits exponent 1: 12 is 2^2 × 3, not 2^2 × 3^1.
  • Every input must be a safe integer no larger than 10,000,000,000; larger values are rejected rather than approximated.

Limitations

  • The calculator reports the complete factorization, not a step-by-step factor tree or a table of trial divisions.
  • Trial division is limited to integers up to 10 billion so the search stays responsive in the browser.
  • Negative integers, zero, one, and non-integers are rejected; sign is not a factor.
  • Cryptographic-scale integers (hundreds of digits) are far outside the scope of this tool.

Common mistakes

  • Stopping at a composite factor: 360 = 8 × 45 is a factorization, but not a prime factorization until 8 and 45 are broken down further.
  • Treating 1 as a prime factor; 1 is omitted because it is not prime and does not change the product.
  • Writing every exponent, including 1, or writing only the distinct primes without their multiplicities — both hide the true factorization.
  • Entering a decimal such as 12.5; prime factorization is defined for integers only.
  • Assuming 1 has a prime factorization. The fundamental theorem of arithmetic starts at 2.
  • Forgetting that a prime input is already fully factored: the answer for 97 is just 97.

Practical use cases

Find a GCF or LCM

Once two numbers are written as products of primes, the GCF takes each shared prime at its smallest exponent and the LCM takes every prime at its largest exponent. For 12 = 2² × 3 and 18 = 2 × 3² the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.

Simplify fractions

Cancel prime factors that appear in both the numerator and the denominator. 360/100 = (2³ × 3² × 5) / (2² × 5²) reduces to (2 × 3²) / 5 = 18/5 after canceling 2² and 5.

Check divisibility and square factors

A number is a perfect square exactly when every exponent in its prime factorization is even. 36 = 2² × 3² is a square; 360 = 2³ × 3² × 5 is not, because 3 and 1 are odd.

Planning and decision guide

Use trial division from the smallest prime

Always start with 2, then odd candidates. Testing in order keeps the factor list sorted and guarantees you never miss a small prime. You only need to test up to the square root of the remaining value: if nothing divides it by then, the remainder is prime.

Prefer exponential form when comparing numbers

GCF, LCM, and perfect-power checks are one glance at the exponents. Keep the expanded product when you need to multiply the factors back or count how many primes there are, including repeats.

Choose a dedicated GCF and LCM calculator for lists

This tool factors one integer. For the greatest common factor or least common multiple of two or more numbers, use the GCF and LCM calculator, which applies the Euclidean algorithm across the whole list.

Frequently asked questions

What is prime factorization?

It is the unique way of writing an integer greater than 1 as a product of prime numbers. For 12 the factorization is 2 × 2 × 3, or 2² × 3 in exponential form.

What is the fundamental theorem of arithmetic?

It states that every integer greater than 1 can be written as a product of primes in exactly one way, ignoring order. That uniqueness is why 360 is always 2³ × 3² × 5 and never a different combination of primes.

What is the prime factorization of 1?

1 has no prime factorization. It is neither prime nor composite, and the fundamental theorem of arithmetic applies only to integers greater than 1. The calculator rejects 1 for that reason.

How do you write prime factorization with exponents?

Group repeated primes as a single base with an exponent equal to how many times it appears. 360 = 2 × 2 × 2 × 3 × 3 × 5 becomes 2³ × 3² × 5. A prime that appears once, such as 5 here, is written without an exponent.

Why does the calculator reject 0, negatives, and decimals?

Prime factorization is defined for integers greater than 1. Zero and one are not products of primes, a negative sign is not a prime factor, and a decimal such as 12.5 is not an integer.

How does the calculator find the factors?

By trial division: it divides out 2 until the remaining value is odd, then tests odd integers 3, 5, 7, … while the candidate squared is at most what remains. Any leftover greater than 1 is itself prime and is appended as the last factor.

How is prime factorization used to find GCF and LCM?

Write each number in exponential form. The GCF uses each shared prime at its smallest exponent; the LCM uses every prime that appears at its largest exponent. For 12 = 2² × 3 and 18 = 2 × 3², GCF = 2 × 3 = 6 and LCM = 2² × 3² = 36.

Is 2 the only even prime?

Yes. Every even integer greater than 2 is divisible by 2, so it has a factor other than 1 and itself and cannot be prime. That is why the calculator peels off all factors of 2 first, then only tests odd candidates.

Sources and review

Reviewed 2026-08-23.

Continue with calculators that answer nearby questions and help compare the next step.