List every prime number between two values, or the first N primes, using a Sieve of Eratosthenes that runs in your browser. Copy or download the list and see the count, sum, gaps and twin primes.
Last updated:
Generate
Up to 10¹², with at most 10 million numbers per range.
Up to 500,000.
Enter your values to see the result.
Advertisement
Advertisement
How to use the Prime Number List Generator
Choose a mode: primes in a range, or the first N primes.
Enter the range (From and To) or how many primes you want.
Pick a filter and separator if you only want twin or palindromic primes, or one prime per line.
Press Generate primes. The list, count and statistics update instantly.
Copy or download the list, or download the table with gaps as CSV.
How the prime list is generated
A prime number is a whole number greater than 1 whose only divisors are 1 and itself. To list primes quickly, this tool uses the Sieve of Eratosthenes: mark every number as a candidate, then for each prime p up to √n cross out p², p² + p, p² + 2p, … Every number left uncrossed is prime. The work grows only a little faster than n (about n log log n steps), which is why a million numbers take a few milliseconds.
For a range that starts far from 1, the tool uses a segmented sieve. It first sieves the small primes up to √(end), then uses only those to cross out composites inside your window. For the first N primes it sieves up to the bound N(ln N + ln ln N), which is always larger than the N-th prime for N ≥ 6.
How many prime numbers are there between 1 and 100?
There are 25 primes below 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. There are 168 primes below 1,000 and 1,229 below 10,000.
Is 1 a prime number?
No. A prime has exactly two different positive divisors, 1 and itself. The number 1 has only one divisor, so it is neither prime nor composite. The smallest prime is 2, which is also the only even prime.
How does the Sieve of Eratosthenes work?
Write down the numbers from 2 to n. Starting with 2, cross out every multiple of each remaining number, beginning at its square. You only need to do this for numbers up to √n. The numbers that are never crossed out are exactly the primes up to n.
Can it list primes in a range that does not start at 1?
Yes. For a range like 1,000,000,000 to 1,000,001,000 the tool uses a segmented sieve: it finds the small primes up to the square root of the end value and uses them to cross out composites only inside your range, so it stays fast even near 10¹².
What are twin primes?
Twin primes are pairs of primes that differ by 2, such as (3, 5), (11, 13) and (41, 43). There are 35 twin prime pairs below 1,000. Whether there are infinitely many twin primes is a famous unsolved problem.
How many primes are there below a number n?
The count is written π(n). The prime number theorem says π(n) is roughly n / ln n, and the logarithmic integral li(n) is an even closer estimate. For example π(1,000,000) = 78,498, while n / ln n gives about 72,382.
What is the 1000th prime number?
The 1,000th prime is 7,919. The 100th prime is 541 and the 10,000th is 104,729. Choose First N primes and enter N to see any of them; the last number in the list is the N-th prime.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.