Prime Factorization Calculator

Enter a whole number to see its prime factorization, every trial division shown, step by step.

Try 60, 97, or 1001

Advertisement

How to use this calculator

Type any whole number and press Calculate. The calculator divides out prime factors one at a time, 2s first, then 3, 5, 7, and so on, and lists every division so you can follow along or check homework.

How it works

Trial division is the straightforward method: try dividing by 2, then 3, then 5…, keeping each prime factor you find and continuing with the quotient. You only need to test divisors up to the square root of what remains, anything larger would already have shown up as a smaller partner factor.

n = p₁ × p₂ × p₃ × …  (each p prime)

Worked example

Example: factor 60

Step 1: 60 ÷ 2 = 30, keep 2.

Step 2: 30 ÷ 2 = 15, keep 2.

Step 3: 15 ÷ 3 = 5, keep 3.

Step 4: 5 is prime, keep 5.

Answer: 60 = 2 × 2 × 3 × 5 = 2² × 3 × 5.

Common mistakes

  • Stopping at a composite quotient: 60 = 6 × 10 is a factorization, but not a prime factorization, keep going until every factor is prime.
  • Skipping the prime 2: always test 2 first; half of all numbers are even and it is the easiest division.
  • Calling 1 prime: 1 is neither prime nor composite. It never appears in a prime factorization.

When to use it

Prime factorization is the engine room of number theory: it simplifies fractions and radicals, finds GCFs and LCMs, tests primality, and underlies modern cryptography. It is also the standard first step taught before fraction work in middle school.

Frequently asked questions

Writing a number as a product of prime numbers only. For 60 that is 2 × 2 × 3 × 5. The fundamental theorem of arithmetic guarantees this breakdown is unique (apart from order).

Use trial division: divide by 2 as many times as possible, then 3, then 5, and so on up to the square root of the remaining quotient. Whatever remains at the end is prime.

No. A prime has exactly two divisors (1 and itself); 1 has only one. It is classified as neither prime nor composite.

Trial-divide by every prime up to its square root. If none divide evenly, it is prime. For 97, you only need to test 2, 3, 5, and 7.