Skip to content

Prime Number Checker

Check primality and list primes up to a limit.

Is 97 prime?
Yes
Checked
97 is prime.

Prime Number Checker tests whether a whole number is prime using trial division, and can optionally list every prime up to that number with a sieve of Eratosthenes. Both operations run instantly and locally in your browser.

How it works

Enter a whole number and the tool checks divisibility by 2 and odd numbers up to its square root to determine primality, reporting the smallest factor when the number is composite. Enable the list option to generate every prime up to a capped limit.

Benefits

  • Checks primality using efficient trial division
  • Shows the smallest factor for composite numbers
  • Can list every prime up to a chosen limit
  • Runs instantly without uploading any numbers

Use cases

  • Verify a number for a math assignment or puzzle
  • Generate a list of primes for a cryptography exercise
  • Explore factorization of composite numbers
  • Check large candidate numbers quickly and privately

Best practices

  • Use the list feature only when you need every prime, not just one check
  • Keep list limits reasonable to avoid a very long output
  • Remember 0, 1, and negative numbers are never prime
  • Use single-number checks for very large candidates

Common mistakes

  • Assuming 1 is a prime number
  • Forgetting that even numbers other than 2 are never prime
  • Requesting a prime list for a number far beyond the cap
  • Expecting instant results for extremely large numbers

Privacy

All primality testing and sieve generation happen locally in your browser. Prime Number Checker does not transmit or store the numbers you enter.

Frequently asked questions

How does the tool check whether a number is prime?
It uses trial division: the number is tested for divisibility by 2 and then every odd number up to its square root. If nothing divides it evenly, it is prime.
What counts as a prime number?
A prime number is a whole number greater than 1 with no positive divisors other than 1 and itself. Numbers like 0, 1, and negative numbers are never prime.
What does "smallest factor" mean for a non-prime number?
For composite numbers, the tool shows the smallest number greater than 1 that divides evenly into it—for example, 91's smallest factor is 7 (91 = 7 × 13).
Why is the list of primes capped at 100,000?
Listing primes uses a sieve of Eratosthenes, which needs memory proportional to the upper bound. Capping the list at 100,000 keeps the browser responsive.
How large a number can I check for primality?
Single-number checks work up to 1,000,000,000,000 while staying fast. Beyond that, trial division becomes too slow for instant browser results.
Does this tool send my numbers anywhere?
No. All primality checks and sieve calculations run locally in your browser using plain JavaScript.

Version 1.0.0 · Updated 2026-07-27 · 30 seconds