Prime Number Checker screenshot Loading Prime Number Checker…

How to Use Prime Number Checker

New window

Prime Number Checker tells you whether a whole number is prime and explains why. If it is composite, it shows the divisor that proves it, the prime factorization and every divisor.

Prime Number Checker showing that 1001 is composite
1001 = 7 · 11 · 13 is not prime

Check a number

  1. Type a whole number in the Number box (up to 1015). The answer appears as you type: a green card for a prime, an orange one for a composite number.
  2. Read the facts: prime factorization, number of divisors, previous and next prime, parity (odd/even) and \(\sqrt{n}\).
  3. Read “How it is decided”: the steps of the test, including the smallest divisor found or the proof that no divisor up to \(\sqrt{n}\) exists.
  4. See the divisors with their count and sum, and where the number sits on the 1–100 grid when it is small.
97 shown as a prime number
97 is prime: it has only two divisors

Primes in a range

  1. Open the Primes in a range tab.
  2. Enter From and To. The range may be up to 200 000 numbers wide.
  3. The app lists all primes in the range and counts them.
The 25 primes between 1 and 100
There are 25 primes between 1 and 100
Tip: click a number in the example chips (2, 97, 91, 561, 1001, 7919 …) to try classic cases: 91 = 7·13 looks prime but is not; 561 is the smallest Carmichael number.

Theoretical Background

New window

Prime and composite numbers

A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself: 2, 3, 5, 7, 11, 13 … A whole number greater than 1 that is not prime is composite: it can be written as \(n = a \cdot b\) with \(1 < a \le b < n\). The number 1 is neither prime nor composite.

By the fundamental theorem of arithmetic, every whole number \(n > 1\) is a product of primes in exactly one way (apart from order):

$$ n = p_1^{e_1}\, p_2^{e_2} \cdots p_k^{e_k} $$

Trial division and the square-root limit

If \(n = a b\) with \(a \le b\), then \(a \cdot a \le a b = n\), so \(a \le \sqrt{n}\). Therefore

$$ n \text{ is prime} \iff \text{no prime } p \le \sqrt{n} \text{ divides } n $$

Only primes need to be tried, because any composite divisor has a smaller prime divisor. For very large numbers the app uses the Miller–Rabin test with fixed bases, which is exact (deterministic) for every number in its range, and then factors composite numbers.

Worked example

Example

Is 1001 prime? \(\sqrt{1001} \approx 31.6\), so try the primes 2, 3, 5, 7, … up to 31.

  • 2: 1001 is odd – no.
  • 3: digit sum 2 – no.
  • 5: last digit 1 – no.
  • 7: 1001 = 7 · 143 – yes.

So 1001 is composite. Continuing with 143 = 11 · 13 gives \(1001 = 7 \cdot 11 \cdot 13\), with \(2 \cdot 2 \cdot 2 = 8\) divisors: 1, 7, 11, 13, 77, 91, 143, 1001.

Is 97 prime? \(\sqrt{97} \approx 9.85\). None of 2, 3, 5, 7 divides 97, so 97 is prime.

Divisor count and sum

$$ \tau(n) = \prod_{i}(e_i + 1), \qquad \sigma(n) = \prod_i \frac{p_i^{e_i+1} - 1}{p_i - 1} $$

For \(1001 = 7 \cdot 11 \cdot 13\): \(\tau = 8\) and \(\sigma = 8 \cdot 12 \cdot 14 = 1344\).

How primes are spread

There are infinitely many primes (Euclid). They get rarer as numbers grow: the prime number theorem says the number of primes up to \(x\) is about

$$ \pi(x) \approx \frac{x}{\ln x} $$

There are 25 primes below 100, 168 below 1000 and 78 498 below one million.

Sieve of Eratosthenes

To list all primes in a range, write the numbers down, then cross out the multiples of 2, 3, 5, 7, … starting from \(p^2\). What remains is prime. The range tab uses this sieve.

FAQ

Why is 1 not a prime number?

A prime has exactly two different divisors. 1 has only one. Leaving 1 out also keeps prime factorizations unique.

Is 2 the only even prime?

Yes. Every other even number is divisible by 2, so it has at least three divisors.

What are twin primes?

Primes that differ by 2, such as 11 and 13 or 71 and 73. Whether there are infinitely many is still an open question.

How large a number can I test?

Up to 10^15 (one quadrillion). The answer is exact for every number in this range.

Version history

  • 2.01 Dec 2026Rebuilt: instant prime test for numbers up to 10^15, reason explained, all divisors, factorization, neighbour primes, 1–100 grid and a primes-in-a-range tab.
  • 1.028 Oct 2024Improvements and fixes
  • 1.018 Oct 2024App added