prime number factorization calculator

Enter any whole number to find its prime factorization, repeated factors, and expanded form.

What is prime factorization?

Prime factorization means writing a number as a product of prime numbers. A prime number is a whole number greater than 1 that has exactly two positive divisors: 1 and itself. For example, 2, 3, 5, 7, 11, and 13 are prime.

When you factor a composite number into primes, the result is unique (ignoring order). This idea is called the Fundamental Theorem of Arithmetic. For instance:

  • 84 = 2 × 2 × 3 × 7
  • Exponent form: 84 = 22 × 3 × 7

How to use this prime number factorization calculator

Step-by-step

  • Enter a whole number (positive or negative).
  • Click Factorize or press Enter.
  • Read the expanded factorization and repeated prime powers.

The calculator handles edge cases such as 0, 1, and negative values. For negative inputs, it factors out -1 first, then factors the absolute value.

Quick examples

Example 1: 360

360 can be broken down into primes as:

360 = 23 × 32 × 5

Example 2: 997

997 has no divisors other than 1 and 997, so it is prime:

997 = 997

Example 3: -126

For negative numbers, include -1:

-126 = -1 × 2 × 32 × 7

Why prime decomposition matters

Prime decomposition appears all over mathematics and computing. A few common uses:

  • Finding the greatest common divisor (GCD) and least common multiple (LCM).
  • Simplifying fractions and ratio problems.
  • Understanding divisibility and number patterns.
  • Building intuition for modular arithmetic and cryptography basics.

Tips for students and teachers

Use both forms

Practice writing factors in both repeated multiplication and exponent notation. This helps with algebra later.

Check your work

Multiply all prime factors back together. If the product is the original number, your factorization is correct.

Know special cases

  • 0: no prime factorization.
  • 1: no prime factors.
  • Prime n: factorization is just n.

FAQ

Is there only one prime factorization for each number?

Yes, for every integer greater than 1, the set of prime factors is unique up to order.

Can very large numbers be factorized?

This calculator supports very large integers using JavaScript BigInt. Extremely large semiprimes can still take time because factorization is computationally hard.

What is a factor tree?

A factor tree is a visual method for breaking a number into smaller factors until every branch ends in a prime number. This calculator gives the same final result in compact form.

🔗 Related Calculators