Math & ScienceExact to 10¹⁵

Prime Factorisation Calculator

Every whole number above 1 has exactly one prime factorisation — that uniqueness is the fundamental theorem of arithmetic, and it is why primes are the building blocks everything else is made of.

Number

Any whole number from 2 upwards. Very large values take a moment.

PRIME FACTORISATION
Exponent form
Is it prime?
Distinct prime factors
Number of divisors
Sum of divisors
Largest prime factor
Previous prime
Next prime

One number, one factorisation

360 = 2³ × 3² × 5, and there is no other way to write it as a product of primes. That uniqueness is the fundamental theorem of arithmetic, and it is the reason 1 is deliberately excluded from the primes — if 1 counted, you could pad any factorisation with as many 1s as you liked and uniqueness would collapse.

Counting divisors without listing them

Take the exponents in the factorisation, add one to each, multiply them together. For 360 = 2³ × 3² × 5¹ that is 4 × 3 × 2 = 24 divisors. The logic is simple: each divisor picks an independent power of each prime, from zero up to the exponent. This is far faster than trial division and is how the calculator gets the count on large numbers.

Why you only test up to the square root

If a number has a factor larger than its square root, the matching co-factor must be smaller than it — and you would already have found that one. So checking divisors up to √n is enough to settle primality. For 1,000,003 that is around a thousand checks instead of a million, and the saving grows enormously as numbers get larger.

Where this stops being a toy

Multiplying two large primes is fast; recovering them from the product is not. That asymmetry is what RSA encryption rests on. The numbers used there run to 600 digits or more — far past anything a browser will factor — and the practical impossibility of reversing the multiplication is precisely the security guarantee.

Frequently Asked Questions

Is 1 a prime number?
No, by definition. A prime has exactly two distinct divisors, 1 and itself; the number 1 has only one. Excluding it is what keeps prime factorisation unique.
How do I find all the factors of a number?
Generate every combination of its prime factors. The calculator lists them all above, sorted, along with the count — which it derives from the exponents rather than by brute force.
What is the fastest way to check whether a number is prime?
Trial-divide by 2, 3 and then every number of the form 6k ± 1 up to the square root. That is what this page does, and it settles any number below about 10¹⁵ almost instantly.
Why does a very large number take longer?
Trial division work grows with the square root of the number, and a large prime is the worst case because no factor is ever found early. Numbers with small factors resolve almost immediately regardless of size.
Where these numbers come from

Sources

Official publications only. Links open the original document in a new tab.