How to use
- 1Type any positive whole number — there is no size limit.
- 2Read the verdict: prime, composite, or neither (for 0 and 1).
- 3See the prime factorization, the previous and next prime, and how the result was checked.
- 4To list primes, enter a range of up to 100,000 numbers and click List.
How primality is tested
A prime is a whole number greater than 1 whose only divisors are 1 and itself. For numbers below one trillion (10¹²), the result is explained by trial division: it is enough to test divisors up to the square root, because any factor larger than √n pairs with one smaller than √n. For 97, √97 ≈ 9.8 and none of 2, 3, 5 or 7 divides it, so 97 is prime. Behind the scenes the tool runs the Miller–Rabin test with the first 13 primes (2 to 41) as bases, which is proven to be deterministic — never wrong — for every number below 3.3 × 10²⁴. Above that bound the result is labelled “probably prime”, with an error chance below 4⁻¹³.
Prime factorization of large numbers
Every integer above 1 is a product of primes in exactly one way — the fundamental theorem of arithmetic. Factors below 1,000 are removed by trial division, and the remaining part is split with Pollard’s rho algorithm (Brent’s variant), which handles numbers of 20 digits or more quickly. If a number is the product of two very large primes, as in RSA keys, factorization stops after a time budget and the result is marked “not fully factored” instead of showing a wrong answer.
Listing primes in a range
The range lister uses a segmented Sieve of Eratosthenes for numbers below 10¹² and the Miller–Rabin test for larger ones, and accepts spans of up to 100,000 numbers. There are 25 primes below 100, 168 below 1,000 and 1,229 below 10,000 — an easy way to sanity-check the output, which you can copy as a comma-separated list.
Frequently asked questions
Is 1 a prime number?
No. A prime has exactly two distinct divisors, and 1 has only one. 0 is not prime either. The smallest prime is 2, which is also the only even prime.
What is the largest number I can check?
There is no fixed limit, since the checker uses BigInt arithmetic. Results are certain below 3.3 × 10²⁴ and probabilistic — but extremely reliable — above.
What is a composite number?
A whole number greater than 1 that is not prime, i.e. it has a divisor other than 1 and itself — for example 91 = 7 × 13.
How do I find the next prime after a number?
Enter the number: “Next prime” shows the smallest prime greater than it, and “Previous prime” the largest prime below it.
Not happy with the results?
Talk to Webin Agency about fast, SEO-friendly websites, e-commerce and Google Ads management.