Prime Factorization Calculator

Every whole number above 1 is a product of primes in exactly one way, ignoring order. This calculator finds those primes by trial division.

Also called: Prime factor calculator · Prime number checker

  • Last updated
  • Formula tested against reference values

Your numbers

From 2 to 1,000,000,000,000,000.

Result

Prime factorisation
—

Calculating…

Written with ^
—
Prime?
—
Distinct prime factors
—
Prime factors counted with repeats
—
Number of divisors
—

How to use this calculator

  1. Enter or choose whole number.
  2. The prime factorisation updates as you type. Use Copy result or Share to keep it.

Method

Divide by 2, 3 and then 6k ± 1 up to √n while each divides evenly; whatever remains above 1 is prime

n
the number to factor

Worked example

  1. 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45: three 2s.
  2. 45 ÷ 3 = 15, ÷ 3 = 5: two 3s.
  3. 5 is prime, so 360 = 2³ × 3² × 5, with (3 + 1)(2 + 1)(1 + 1) = 24 divisors.

360 = 2³ × 3² × 5.

What the result means

The factorisation gives the GCF (shared primes at their lowest powers), the LCM (all primes at their highest powers) and the number of divisors.

Assumptions and limits

  • Whole numbers from 2 to 10¹⁵, which the browser handles exactly.
  • Larger numbers need specialised algorithms; trial division up to 10¹⁵ can take a moment for a large prime.

Questions

Why is the factorisation unique?

This is the fundamental theorem of arithmetic: apart from the order of the factors, there is only one way to write a number as a product of primes.

How do I use it to simplify a square root?

Pair up equal primes: 360 = 2² × 3² × 10, so √360 = 2 × 3 × √10 = 6√10.