Skip to content

Prime number checker

Check whether an integer is prime and see a divisor or the exact trial-division evidence.

Exact primality check97 Prime

No integer divisor from 2 through 9. Trial division through √97 proves this result.

Only divisors through ⌊√n⌋ = 9 are needed.

Whole numbers from 0 to 4,294,967,295.

No probabilities: every answer is proven within the stated range.

Processed on your device

How it works & useful details

How it works & limits

A prime is an integer greater than 1 divisible only by itself and 1. Zero and one are neither prime nor composite. Even numbers are checked first, then odd candidates up to the square root.

Checks are exact for integers from 0 to 4,294,967,295. The largest input needs fewer than 33,000 divisions, so this bounded preview stays local and quick. A composite result shows one factor pair, not a complete prime factorization.

Your working space

Change the values to explore the preview. Use the action below to create a copyable, downloadable result. All calculations stay on this device; refreshing clears your work.

About this tool

Prime number checker determines whether an integer is prime and shows the evidence: either a divisor that proves it is composite, or the trial division that confirms primality. It is a teaching aid as much as a checker.

The check runs locally and is bounded so a very large input cannot lock up the page. Results use exact integer arithmetic.

How to use it

  1. Enter the integer you want to check.
  2. Run the check and read whether the number is prime.
  3. For composite numbers, inspect the divisor that was found.
  4. For primes, review the trial-division evidence.

Worked example

Is 221 prime? It is odd, so 2 is ruled out immediately. The tool then tries odd divisors up to √221 ≈ 14.87: 3, 5, 7, 9, 11, 13. Dividing by 13 leaves no remainder, so 221 = 13 × 17 is composite.

For 97, the candidates up to √97 ≈ 9.85 are 2, 3, 5, 7, and 9. None of them divides 97, so it is prime. Checking beyond the square root is unnecessary, because any factor larger than it would pair with one smaller than it that would already have been found.

Where primes show up

Primes are the building blocks of every integer: each whole number greater than 1 factors into primes in exactly one way. They are used in hash table sizes, in checksum schemes, in scheduling problems where cycles should not line up, and in public-key cryptography such as RSA, which uses primes hundreds of digits long.

This tool covers integers from 0 to 4,294,967,295, the range of an unsigned 32-bit number, where trial division is fast and exact. Cryptographic primes are far larger and are checked with probabilistic tests instead.

Frequently asked questions

What makes a number prime?

A prime has exactly two positive divisors: one and itself. Numbers less than two, and zero and one in particular, are not prime.

How large a number can I check?

Enter a whole number from 0 to 4,294,967,295. Checks are exact throughout this range. Larger integers are rejected rather than checked slowly or approximately.

Does it factor numbers completely?

It reports a divisor for composites, which proves the result but is not a full factorization.

Is 2 a prime number?

Yes. 2 is the only even prime, because every other even number is divisible by 2.