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.
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?
How do I find all the factors of a number?
What is the fastest way to check whether a number is prime?
Why does a very large number take longer?
Sources
Official publications only. Links open the original document in a new tab.
- National Institute of Standards and Technology Special Publication 811 — Guide for the use of the SI Significant figures and rounding conventions
- National Institute of Standards and Technology CODATA fundamental physical constants Values of the fundamental physical constants