Prime Number Generator
List every prime up to a limit, or generate the first N primes.
What is Prime Generator?
A prime list answers two different questions: which primes are below 100, and what the first twenty-five primes are. They look similar and are not — the first has a known bound to work up to, the second does not — and the natural algorithm for each is different, so the page offers both.
How it works
Up to a limit, the sieve of Eratosthenes marks off multiples in one pass and answers the question for every number in the range at once. For a count, candidates are tested one at a time because there is nothing to sieve up to until the answer is known. Both are capped — a sieve over tens of millions in the main thread is a frozen tab — and the cap is stated rather than silently applied.
- Enter your input. Type or paste your input into the field above — the tool responds instantly.
- Review the result. Output updates live as you type. Everything runs entirely in your browser.
- Copy or download. Use the Copy button to grab the result, or Download to save it as a file.
Examples
Realistic sample
Type or paste any realistic input — the tool computes the result locally and instantly.
Common mistakes
Expecting a server round-trip
Nothing is uploaded — every tool in this category runs entirely in your browser.