Skip to content

Prime factorization calculator

Test one positive integer and write it as an exact product of prime factors.

n → prime? → pᵃ × qᵇ

Enter a positive integer

Your data stays in this browser.

Use one whole number from 1 to 1,000,000,000,000. Decimals and scientific notation are not accepted.

Exact integer result

Prime test and factors

Enter a number and choose Calculate to see the result.

How to use the prime factorization calculator

  1. Enter one positive whole number. Do not add digit-grouping commas, a decimal point, or scientific notation; the calculator preserves the integer exactly.
  2. Choose Calculate, or press Enter while the number field is focused. The calculator first decides whether the number is prime, composite, or the special value 1.
  3. Read the factorization in exponent form and expanded multiplication form. If you edit the input, the old result and copied status disappear until you calculate again.
  4. Use Copy results when you want the classification and both factor forms as plain text. Clear removes the input, result, error, and copy status.

What prime factorization means

Every positive integer greater than 1 is either prime or can be written as a product of primes in one unique way apart from factor order. For example, 360 = 2³ × 3² × 5.

The calculator divides by 2 and then tests odd possible factors only while the candidate squared is no larger than the remaining value. A remainder greater than 1 is itself a prime factor. All arithmetic uses exact integers.

A prime has exactly two positive divisors, 1 and itself. The number 1 has only one positive divisor, so it is neither prime nor composite and its prime-factor list is empty.

Worked examples

Factor a composite number: 360

Enter 360 and calculate. Repeated division finds three factors of 2, two factors of 3, and one factor of 5. The result is 2³ × 3² × 5, or 2 × 2 × 2 × 3 × 3 × 5. Multiplying those values returns 360.

Test a prime number: 999983

Enter 999983 and calculate. No prime candidate up to its square root divides it, so the number is prime. Its factorization is simply 999983. A prime appearing by itself is still a complete prime factorization.

Understand the special case: 1

Enter 1 and calculate. The calculator reports neither prime nor composite and shows no prime factors. This is a defined mathematical boundary, not an input error.

When prime factors are useful

Input limits and error help

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two positive divisors. One has only the divisor 1, so it is neither prime nor composite and has no prime factorization.

Is 2 prime?

Yes. Two is the smallest prime and the only even prime. Every larger even integer is divisible by 2 and therefore composite.

Why is a prime shown as its own factorization?

A prime cannot be split into smaller prime factors. Writing p = p is the complete product of primes for that value.

Does factor order matter?

No. Multiplication is commutative, so 2 × 3 and 3 × 2 describe the same factorization. The calculator sorts factors from smallest to largest for consistent reading.

Can I factor a number larger than one trillion?

Not on this page. The published ceiling protects browser responsiveness. A specialized large-integer factoring tool uses different algorithms and is outside this calculator’s scope.