Prime factorisation calculator

Decompose any positive integer into its prime factors. The result is shown in expanded form, exponent form, with the factor tree, and with the divisor count.

Prime factorisation input

Prime factorisation
2³ × 3² × 5
Expanded form
2 × 2 × 2 × 3 × 3 × 5
Distinct primes
3
Number of divisors
24
Is prime?
No
Factor tree
Trial division working

The fundamental theorem of arithmetic

Every integer greater than 1 has a unique prime factorisation (up to ordering of the factors). That uniqueness is what makes prime factorisation the canonical "fingerprint" of a number.

n = p₁e₁ · p₂e₂ · … · pkek

From the prime factorisation you can immediately read off:

  • The total number of divisors: σ0(n) = Π(ei + 1).
  • The sum of all divisors: σ1(n) = Π((piei+1 − 1)/(pi − 1)).
  • Whether n is a perfect square (every ei even) or a prime (one factor with exponent 1).

FAQ

Why isn't 1 included in the factorisation?

By convention 1 is not prime, and including it wouldn't add anything useful — multiplying by 1 leaves the number unchanged. Excluding 1 keeps factorisations unique.

How big can the input be?

Trial division is fast for numbers up to about 10¹². Beyond that, runtime grows; for very large numbers use a dedicated cryptographic factoriser.

What if the number is prime?

The factorisation is just the number itself. The "Is prime?" row shows "Yes" and the divisor count is 2 (1 and the number).

Related calculators