← All tools
// Number

Prime Number Generator online

List all prime numbers up to any limit - Sieve of Eratosthenes

Prime Number Generator logo
by
CHUNKY
MUNSTER

Prime List Generation Instructions

  1. Enter the upper limit for your prime number search (up to 100,000).
  2. Click "Generate" to run the Sieve of Eratosthenes in your browser.
  3. Review the count and the largest prime found in the results.
  4. Download the full list as a .txt file for your records.

Prime Number Generator implements the textbook Sieve of Eratosthenes: it allocates a boolean array of length N + 1, repeatedly walks through unmarked integers starting at 2, and crosses out every multiple. Whatever survives are the primes up to N. Time complexity is O(n log log n), which is the fastest known sieve for this problem class.

Sieve of Eratosthenes Algorithm

The 100,000 cap keeps the in-memory bit array small enough for mobile browsers; for larger ranges a segmented sieve and a desktop language are the right tools. This math tool provides a fast way to generate an integer sequence of primes for research or development. The output panel shows the prime counting result and the largest prime in the range, both useful for quick checks. The full list can be downloaded as plain text for use in other programs.

Frequently Asked Questions

How does the Sieve of Eratosthenes work?

Write down every integer from 2 to N. Take the first uncrossed number (2), mark every multiple of it as composite, then move to the next uncrossed number and repeat. What remains uncrossed at the end are exactly the primes.

Why is the upper limit 100,000?

The sieve allocates one boolean per integer in the range, so memory grows linearly with the limit. 100,000 keeps the page responsive on phones and laptops; higher limits are better suited to a segmented sieve in a desktop language.

How many primes are there up to N?

Asymptotically about N / ln(N) - the prime number theorem. Up to 1,000 there are 168 primes; up to 10,000 there are 1,229; up to 100,000 there are 9,592. The exact count for your chosen limit is shown in the stats row.

Is the output sorted?

Yes, in ascending order. The sieve naturally produces primes in increasing order because it walks the integers from 2 upward.

Explore the full suite of Number tools and 290+ other free utilities at Chunky Munster. For rapid integer sequence exploration, bookmark this Prime Number Generator.