I often have to generate a sequence of prime numbers so I created this simple utility that does it for me. It lets you generate as many primes as you need, starting from any value. It works in the browser and is powered by alien technology from the future.

Prime Number Sequence Generator Options

Start and Count
Prime Number Separator
Prime Number Base

Prime Number Sequence Generator Examples (click to try!)

First Twenty Primes
In this example, we generate a sequence of twenty prime numbers. The smallest prime number is 2, so we start with it and print every prime on a new line.
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
Generate this many prime numbers.
Starting value.
Separate primes with this character.
Decimal Base
Primes from One Hundred
This example generates 100 sequential prime numbers starting from the value of 100 and uses the comma character to separate them.
101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691
Generate this many prime numbers.
Starting value.
Separate primes with this character.
Decimal Base
Binary Prime Numbers
This example generates a list of primes in the binary base. It starts from the value 128 and generates 8 prime numbers.
10000011
10001001
10001011
10010101
10010111
10011101
10100011
10100111
Generate this many prime numbers.
Starting value.
Separate primes with this character.
Binary Base

How Does This Prime Number Sequence Generator Work?

This prime number list generator works entirely in your browser and is written in JavaScript. First, it checks if the start value (specified in options) is odd if it's not, it adds 1 to it (prime numbers can't be even). Then, it starts a loop from start with a step of 2 and in this loop, it tests whether the current number is prime. To do this, it uses the isPrime(n) function, which implements the Sieve of Eratosthenes algorithm to check if the given number n has any divisors except for 1 and itself. As there are infinitely many primes, this loop runs until it finds as many sequential primes as specified in the count options. Finally, it calls the join(separator) function on the array that holds the primes and this separates them with the separator character (specified in options).

Created by Browserling

This prime number sequence generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by Browserling's programmer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my tools, then I love you, too! Use coupon code COMLING to get a discount at my company Browserling.