← 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

How to Use the Prime Number Generator

  1. Paste or enter your input into the text field.
  2. Configure any options (format, delimiter, encoding, or mode) using the controls above the output.
  3. The result updates instantly — no submit button required for most operations.
  4. Click Copy or Download to take the output to your next step.

This tool 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.

How the Prime Number Generator Works

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. The output panel shows the count and the largest prime in the range, both useful for quick number-theory 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.